Skip to content

Git

Tips

Create a new branch and push to remote
git checkout -b <new-branch>
git push -u origin <new-branch>
Edit a remote branch
git fetch origin <remote-branch>
git checkout <remote-branch>
# Make changes and commit
git push origin <remote-branch>
Rename a branch name
  • Rename the current branch:
    git branch -m <new-branch-name>
    
  • Rename a specific branch:
    git branch -m <old-branch-name> <new-branch-name>