Create a branch
Git branch <local_branch_name>
Create and switch to a new branch
Git checkout-b <local_branch_name>
Switch branches
git checkout <local_branch_name>
Merging branches
git merge <local_branch_name>
Merge is a merge of two branches, if you want to merge b_branch into the A_branch,
The actual operation is to switch to A_branch first and then execute merge on A_branch.
git checkout <A_branch>
git merge <B_branch>
?
Conflicts must be resolved if a conflict occurs in the merge.
Git conflict resolution:
。。。。。。。
。。。。。。
。。。。。
。。。。
。。。
?
?
git status
Git commit
git push
Git push Origin <local_branch_name>:<remote_branch_name>
?
git Delete Branch
Git branch-d <local_barnch_name>
Git branch-d <local_banrch_name>
Git branch Rename
git branch-m <old_branch_name> <new_branch_name>
Git to see the branches that have been merged
Git branch-merged
Git view non-merged branches
Git branch?--no-merged
?
Git rebase
Rebase is actually a patch that hits the current branch on the specified branch, and finally the current branch is combined with the specified branch. The difference between this and merge is that the current branch merges with the specified branch and produces a new commit, making the entire Git project look neater, while the merge retains all the branch commit records.
You can see that git rebase is similar to git merge. And the conflict that is going to arise
Conflict resolution, see above.
?
GIT branch Management