Skip to content

Instantly share code, notes, and snippets.

@shabin-slr
Created October 6, 2016 03:49
Show Gist options
  • Save shabin-slr/f480817116076088ff7734429c7a7312 to your computer and use it in GitHub Desktop.
Save shabin-slr/f480817116076088ff7734429c7a7312 to your computer and use it in GitHub Desktop.
Some Git Commands
#Show Remote of current branch
#Reference : http://stackoverflow.com/questions/171550/find-out-which-remote-branch-a-local-branch-is-tracking
git branch -vv
#Create local branch from remote
#http://stackoverflow.com/a/1787014/3370859,
#eg. : "git checkout test", will create local branch test from origin/test
git checkout <branch name without /origin>
#Delete a local branch
http://stackoverflow.com/questions/2003505/how-to-delete-a-git-branch-both-locally-and-remotely
git branch -d the_local_branch
#Delete a remote branch
http://stackoverflow.com/questions/2003505/how-to-delete-a-git-branch-both-locally-and-remotely
git push origin --delete the_remote_branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment