Skip to content

Instantly share code, notes, and snippets.

@rvteja92
Last active May 18, 2017 15:54
Show Gist options
  • Save rvteja92/1663ee027941f82f4386d5782b7a95c9 to your computer and use it in GitHub Desktop.
Save rvteja92/1663ee027941f82f4386d5782b7a95c9 to your computer and use it in GitHub Desktop.
Git Cheat Sheet

Clean the local files (and directories) and update with remote files (and directories)

git fetch origin master
git reset --hard FETCH_HEAD
git clean -df

Replace all local changes and pull remote repo

git fetch --all
git reset --hard origin/master

For other brances use git reset --hard origin/<branch_name>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment