Skip to content

Instantly share code, notes, and snippets.

@neilff
Last active December 19, 2015 21:48
Show Gist options
  • Save neilff/6022532 to your computer and use it in GitHub Desktop.
Save neilff/6022532 to your computer and use it in GitHub Desktop.
Useful Git Commands
Force local repo to match git repo
-----------------------------------------------------
git fetch origin
git reset --hard origin/master
Remove directories or files from the repo
-----------------------------------------------------
git rm -r one-of-the-directories
git commit -m "Remove duplicated directory"
git push origin master
List all the files in the repo branch (HEAD)
-----------------------------------------------------
git ls-tree --full-tree -r HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment