Skip to content

Instantly share code, notes, and snippets.

@sworup
Last active June 16, 2017 06:11
Show Gist options
  • Save sworup/20e2f26ed0252747ac5ceed06893f549 to your computer and use it in GitHub Desktop.
Save sworup/20e2f26ed0252747ac5ceed06893f549 to your computer and use it in GitHub Desktop.
Git commands listing
git checkout develop && git pull --rebase
// Listing out branches
$ git branch // List local branches
* master
$ git branch -a // List all branches
* master
origin/1-2-stable
origin/2-0-stable
origin/2-1-stable
origin/2-2-stable
origin/3-0-unstable
origin/HEAD
origin/master
$ git branch -r // List remote branches
origin/1-2-stable
origin/2-0-stable
origin/2-1-stable
origin/2-2-stable
origin/3-0-unstable
origin/HEAD
origin/master
git merge --no-commit --no-ff issue/#467
// Rename your local branch.
// If you are on the branch you want to rename:
git branch -m new-name
// If you are on a different branch:
git branch -m old-name new-name
// Delete the old-name remote branch and push the new-name local branch.
git push origin :old-name new-name
// Reset the upstream branch for the new-name local branch.
// Switch to the branch and then:
git push origin -u new-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment