Created
November 14, 2011 21:27
-
-
Save syranez/1365239 to your computer and use it in GitHub Desktop.
Git Beginners Cheatsheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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