git - Check if a commit is merged to another branch, and if so, what is the merge commit? -
suppose git repo has 2 branches, master
, test
. commita
made on test
branch. want check:
commita
has been merged master
branch? if so, sha of merge commit? i want check these programmatically (not using gitk
).
by example, branch test
@ commit commita
. can check commita
has been merged master
command:
git branch --contains test
this should list branches contains commita
, check see if master
in list.
for getting sha of commita
type:
git rev-parse test
the sha of merge commit , commita
same.
git merge
No comments:
Post a Comment