0 votes
1 view
in Devops and Agile by (28.1k points)

I have an old branch, which I would like to delete. However, before doing so, I want to check that all commits made to this branch were at some point merged into some other branch. Thus, I'd like to see all commits made to my current branch which has not been applied to any other branch [or, if this is not possible without some scripting, how does one see all commits in one branch which have not been applied to another given branch?.

1 Answer

0 votes
by (48k points)

You can get the list of commits in a branch you can use 

git branch --contains <branch-name>

Which will show you the commits that are specified in the branch? If you get more than one branch name then it means the branch is merged.

Alternatively, you can use 

git log <current-branch> <merge-branch> 

This will show you what current-branch needs to have everything that merge-branch has.

 Reference: https://git-scm.com/docs/git-branch#Documentation/git-branch.txt---containsltcommitgt

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...