Skip to content

Instantly share code, notes, and snippets.

@Jwan622
Last active May 25, 2020 14:01
Show Gist options
  • Save Jwan622/720ca24472b6f1f6f514ce7879672ac5 to your computer and use it in GitHub Desktop.
Save Jwan622/720ca24472b6f1f6f514ce7879672ac5 to your computer and use it in GitHub Desktop.
git commands
git rebase -i origin/master
- use it to rebase the branch using a root of origin/master
git log origin/master..HEAD
- log everything in head that isn’t in origin/master. it’s a venn diagram
git checkout <git sha> -- <file_path>
if you only want changes from a specific file from a specific commit. If you do this from a parent, it will move changes to parent.
to do a fixup or change a commit:
- git commit --fixup=1f870743ab331f8314d740f2529
- if you then run git log origin/master..HEAD you should see the fixup as the HEAD
to complete the fixup:
- git rebase -i origin/master --autosquash
- that squashes the fixup into the correct commit using the fixup! keyword and message of the fixup commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment