Skip to content

Instantly share code, notes, and snippets.

@azibom
Created October 31, 2020 11:20
Show Gist options
  • Save azibom/c64eef2742375fbae6db3039685466c3 to your computer and use it in GitHub Desktop.
Save azibom/c64eef2742375fbae6db3039685466c3 to your computer and use it in GitHub Desktop.
Git info

How rename the branch:

git branch -m <new_name>

How undo the commit:

git reset --soft HEAD~1

How remove the remote branch:

git push -d origin

How sync with the remote branch:

git reset --hard HEAD
git clean -f -x -d -n
git status

Your branch is ahead of 'xxxx' by N commits.

git reset --hard HEAD~N
git pull
git status

How change the last commit message:

git commit --amend -m "New commit message."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment