Skip to content

Instantly share code, notes, and snippets.

@VladRez
Last active September 8, 2018 02:16
Show Gist options
  • Save VladRez/3cf1472aa39ac23dec822c51e6918fef to your computer and use it in GitHub Desktop.
Save VladRez/3cf1472aa39ac23dec822c51e6918fef to your computer and use it in GitHub Desktop.
Notes on using Git

Clone Bare Repo

Clone all branches in a repository at once. Add extra .git to clone without main directory.

git clone --bare https://gitgub.com/user/repo.git .git

Convert to regular github project

git config -- bool core.bare false

Reset the .git HEAD pointer to ensure the project is at its last date.

git reset --hard

See all the branches

git branch

Add NodeJs and NPM to Git Bash in Windows

In Git Bash Console navigate to Git Bash install directory and type:

export PATH=$PATH:'/c/program files/nodejs/'

/c/program files/nodejs/ is nodejs's default install directory, change as needed.

Add nodemon to Git Bash in Windows

npm i -g nodemon@latest
export PATH=$PATH:'/c/Users/<USERNAME>/AppData/Roaming/npm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment