Skip to content

Instantly share code, notes, and snippets.

@iamaravi
Created September 26, 2014 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamaravi/68f272436b1b49dea286 to your computer and use it in GitHub Desktop.
Save iamaravi/68f272436b1b49dea286 to your computer and use it in GitHub Desktop.
Common git commands
#Branching
Create
git checkout -b [name_of_your_new_branch]
git push origin [name_of_your_new_branch]
Delete
git branch -D [name_of_your_new_branch]
git push origin :[name_of_your_new_branch]
#Tagging
Create
git tag -a v1.4 -m 'my version 1.4'
git push origin v1.5
Drop
git tag -d 12345
git push origin :refs/tags/12345
# Commit
Create
git add <file>
git commit -m <custom message>
git push origin <branch name>
Delete/Undo
git reset --[soft|hard] HEAD~1
#push
git push origin <branchname>
#pull
git pull origin <branchname>
#ignoring chmod change
git config core.fileMode false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment