Skip to content

Instantly share code, notes, and snippets.

@skobba
Last active July 8, 2019 12:14
Show Gist options
  • Select an option

  • Save skobba/25719da00bb554ca61decb7480c01e9d to your computer and use it in GitHub Desktop.

Select an option

Save skobba/25719da00bb554ca61decb7480c01e9d to your computer and use it in GitHub Desktop.
git reset
# git reset (n: number of commits)
git reset HEAD~n
# Rename branch
git branch -m <oldname> <newname>
git push -f
No upstream branch...
git push origin HEAD
# delete branch (-D = force)
git branch -D chore/gs/hotreload
# delete remote branch
git push <remote_name> --delete <branch-name>
# push to origin after renaming branch
git push origin HEAD
# change upstream branch
git branch branch_name -u your_new_remote/branch_name
git branch feat/gs/helptexts origin/feat/gs/helptexts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment