Skip to content

Instantly share code, notes, and snippets.

@blackfist
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blackfist/9063393 to your computer and use it in GitHub Desktop.
Save blackfist/9063393 to your computer and use it in GitHub Desktop.
Git stuff I don't want to forget

fetch a remote branch

git checkout --track origin/daves_branch

Undo a commit from a few commits ago that was pushed up to github. Be warned that if you do this everyone will have to basically blow away their local copy of the repo and do a fresh git pull.

git rebase -i HEAD~4 
git push --force

That will show all the commits going back 4 and let you pick which ones you want to keep. A better way might be to delete the files, then you wont be rewriting history

git diff-tree --no-commit-id --name-only -r d6598094535cdfbfd41a3e8c77b9f6711a7ad8c7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment