Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
556 views
in Technique[技术] by (71.8m points)

git - 我怎么知道分支是否已经合并到master中?(How can I know if a branch has been already merged into master?)

I have a git repository with multiple branches.

(我有一个带有多个分支的git存储库。)

How can I know which branches are already merged into the master branch?

(我怎么知道哪些分支已经合并到master分支中?)

  ask by hectorsq translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

git branch --merged master lists branches merged into master

(git branch --merged master列出合并到master的分支)

git branch --merged lists branches merged into HEAD (ie tip of current branch)

(git branch --merged列出合并到HEAD中的分支(即当前分支的尖端))

git branch --no-merged lists branches that have not been merged

(git branch --no-merged列出尚未合并的分支)

By default this applies to only the local branches.

(默认情况下,这仅适用于本地分支。)

The -a flag will show both local and remote branches, and the -r flag shows only the remote branches.

(-a标志将显示本地和远程分支, -r标志仅显示远程分支。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...