Skip to content

Instantly share code, notes, and snippets.

@gitaarik
Last active December 10, 2021 16:35
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save gitaarik/6173977 to your computer and use it in GitHub Desktop.
Save gitaarik/6173977 to your computer and use it in GitHub Desktop.
Git cheatsheet

Git cheatsheet

Checkout remote branch:
git checkout -t remote_name/remote_branch_name
Delete a branch at the origin:
git push origin --delete <branchName>
See changes you're gonna commit:
git diff origin/master

Add --stat to only show the files instead of the complete diff.

Check the differences made in the last commit
git show
Initiate and update all submodules
git submodule update --init --recursive
Add a submodule that tracks a certain branch instead of a certain commit
git submodule add -b master [URL to Git repo]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment