1. Create local branch Local_branch
Git branch Local_branch
2. Create local branch Local_branch and switch to Local_branch branch
Git checkout-b local_branch
3. Switch to Branch Local_branch
git checkout Local_branch
4, push local branch local_branch to remote branch Remote_branch and establish association relationship
A. Remote already has a Remote_branch branch and has associated local branch Local_branch and has switched locally to Local_branch
git push
B. Remote already remote_branch branch but not associated with local branch Local_branch and Local has switched to Local_branch
Git push-u origin/remote_branch
C. Remote does not have Remote_branch branch and, Local has switched to Local_branch
Git push Origin Local_branch:remote_branch
5. Delete local branch Local_branch
Git branch-d local_branch
6. Delete Remote Branch Remote_branch
git push origin:remote_branch
Git branch-m | -M oldbranch newbranch Rename branch, if newbranch name branch already exists, you need to force rename using-M, otherwise, use-M to rename.
Git branch-d | -D branchname Delete Branchname Branch
Git branch-d-R branchname Remove remote Branchname Branch
7. View local Branch
Git branch
8. View remote and local branches
Git branch-a