Skip to content

Instantly share code, notes, and snippets.

@glpunk
Last active March 28, 2019 14:58
Show Gist options
  • Save glpunk/24a48e4704bba152bfbbdee3c5fd561e to your computer and use it in GitHub Desktop.
Save glpunk/24a48e4704bba152bfbbdee3c5fd561e to your computer and use it in GitHub Desktop.
Git Commands #GIT
# git delete branch with force
git branch -D branch_name
# git rename branch
git branch -m <oldname> <newname>
# ... or if the current branch
git branch -m <newname>
# change up stream
git branch branch_name -u your_new_remote/branch_name
# ... or in current branch
git branch -u origin/develop
# reset branch to current origin status
git checkout mybranch
git reset --hard origin/mybranch
# take specific comit
git cherry-pick
# force push to remote branch with different name
git push --force origin qa:develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment