Skip to content

Instantly share code, notes, and snippets.

@ianfinch
Last active June 26, 2020 00:04
Show Gist options
  • Save ianfinch/4e850f0682685a269242b7e4418e9574 to your computer and use it in GitHub Desktop.
Save ianfinch/4e850f0682685a269242b7e4418e9574 to your computer and use it in GitHub Desktop.
Reminder of git commands
See all remotes ....................... git remote -v
Fetch a specific remote ............... git fetch <remote name>
Compare remote with local files ....... git diff --name-only remotes/<remote name>/master
Compare remote with main repo ......... git diff --name-only master remotes/<remote name>/master
Squash commits ........................ git rebase -i <after this commit>
Squash commits into initial commit .... git rebase -i --root
Force submit after squashes ........... git push origin +master
Replace "pick" with "reword" to change the commit message
Replace "pick" with "squash" to combine a commit with the last "pick" commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment