1. Switch branches: git checkout branch_name;
2. Merge branch: Switch to master First, then execute git merge branch_name;
3. Delete the remote branch:git push origin :branch-name
The space in front of the colon should not be less, the principle is to push an empty branch to the server, equivalent to delete the branch.
4. Delete local branch: Git branch-d branch_name; (-D: Mandatory Delete)
5. View remote branch: Git branch-r;
View local branch: Git branch;
View all the local and remote branches: git branch-a;
6. Push the local branch to the remote as Master branch: Git push Origin branch_name;
Git push Origin branch_name:branch_name;
7. Get the remote branch git checkout-b branch_name origin/remote_branch_name;
Local modification of the acquired remote branch is pushed to the remote corresponding branch: Git push Origin remote_branch_name;
(If you are git pull prompted "No tracking information", the link relationship between the local branch and the remote branch is not created,
With the command git branch --set-upstream branch-name origin/branch-name . )
8. Create a branch: Git branch branch_name;
Switch branches: git checkout branch_name;
Create and switch branches: git checkout-b branch_name;
Merge a branch to the current branch:git merge <branch_name>;
Common Command collection for Git