View local branches
Git Branch * Dev master
* Indicates that the current Dev branch is located.
View remote branches
Git Branch -- remote origin/dev origin/Master
View All remote and local branches, with the-A PARAMETER
Git branch-A * master remotes/ORIGIN/head-> origin/Master remotes/ORIGIN/develop remotes/ORIGIN/issue_193
Create Branch
Git checkout-B new_branch
Note: new_branch'sCodeFrom current Branch
Switch Branch
Git checkout another_branch
It is different from creating a branch-parameter B
Push local branch code to remote server
Git push origin branch_name
If the remote server does not have this branch, it will automatically create
Pull remote branch code to local branch
Git pull origin branch_name
To delete a local branch, you must switch to another branch before deleting a branch.
Git checkout bgit branch-D
Delete remote Branch
Git push Origin -- delete branch_name
Merge local branches
Git merge B
If the current branch is Dev, the above command is to merge the local B branch code into the current branch Dev.
Merge remote branches, which is almost the same as the previous one,
Git merge origin/B
The remote branch B is merged into the current local branch Dev.
Let's get a fine-grained merge. If my current branch is develop and I want to transfer build. LSP merge in a branch to the develop branch, what should I do? Checkout!
Git checkout a build. LSP