Merging and deleting Git branches

In Git, branch merging and deletion are common operations. This article will show you how to merge one branch into another, and delete the one you've already done.

Merge branch:

  1. git checkout [target_branch]: switch to the target branch.
  2. git merge [source_branch]: Merge the source branch into the target branch.

Delete branch:

  1. git branch -d [branch_name]: delete the completed branch.
  2. git branch -D [branch_name]: Forcefully delete unmerged branches.

Guess you like

Origin blog.csdn.net/weixin_42279822/article/details/131128767