Skip to main content

Cheat Sheet

Skip the pre-commit hook

git commit -n

Rename local branch

git branch -m <old_name> <new_name>

Rename current local branch

git branch -m <new_name>

Rename local and remote branch

git branch -m <new_name>
git push origin --delete <old_name>
git push origin -u <new_name>

Change the remote origin's url

git remote set-url origin <new_url>

Set up identity

git config --global user.email "<user_email>"
git config --global user.name "<user_name>"