Skip to content

Instantly share code, notes, and snippets.

@juliankrispel
Last active December 12, 2015 06:38
Show Gist options
  • Save juliankrispel/4730814 to your computer and use it in GitHub Desktop.
Save juliankrispel/4730814 to your computer and use it in GitHub Desktop.
Git Cheatsheet

Pull from branch from remote repository 'origin'

git pull origin master

push to branch 'master' from remote repository 'origin'

git push origin master

Commit with message "Message"

git commit -m "Message"

Add a Tag

git tag -a latest -m "Latest version"

Override Tag

git tag -a latest -f

Push Tags

git push --tags

Remove a tag

git tag -d tagname
git push origin :refs/tags/tagname

Ammend Commit message

git commit --amend -m "New commit message"

Add submodule

git submodule add git://git-link local-folder

Download submodules after clone

git submodule update --init

Update a local repository with remote HEAD

git remote update 
#or
git fetch remote <branchName>

Delete and merge branch both remote and locally

git branch -d <localBranchName>
#and
git push origin :<remoteBranchName>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment