Skip to content

@syranez /git_beginners_cheatsheet

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
Git Beginners Cheatsheet
# Git Tag
Lightweight: git tag <name> <commit-id>
Annotated: git tag -a <name> <commit-id>
Show tag: git show <name>
Check Annotated: git tag -v <name>
# remove file from index but do not delete it.
$ git rm --cached file
# diff staging area with index
$ git diff --staged
# amend a commit
$ git commit --amend
# e. g. add a file
$ git commit -m "first commit with forgotten file"
$ git add forgotten_file
$ git commit --amend # edit commit message on base current stage
# Remotes
# Tell me something about my known remotes
git remote
# Tell me something about [remote-name]
git remote show [remote-name]
# add remote
git remote add [remote-name] [remote]
# rename [remote-name]
git remote rename [remote-name] [new-remote-name]
# get remote
git fetch [remote-name]
# Pull (=fetch + merge)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.