git - Merged commits listed as unmerged in branch diff -


consider repo following branches:

master: a-b-c-d-e

development: a-b-c-d-e-f-g

when run git log master..development --oneline receive following:

c <hash> <commit message>  d <hash> <commit message> e <hash> <commit message> f <hash> <commit message> g <hash> <commit message> 

so though c d e in both branches, reported unmerged. furthermore, when attempt merge development master, duplicate commits, 1 original commit hash, , other new commit hash.

i've inherited repository , i'm wondering might have caused such issue, if should concerned, , best course of action is. need merge in new commits f g master , i'm trying figure out best approach keep things clean possible.

thanks in advance

while not entirely sure reason why happening, have idea on how can merge branches without creating these duplicates commits.

the solution use git cherry-pick. cherry-pick replay specific commits onto tip of current branch without regard commit history, works if commit can apply cleanly new branch (which should fine long both versions of c d e have same changes.

first, make sure on master branch. there, following command:

$ git cherry-pick f g 

make sure f , g respective commits' hashes.

if command fails, willing bet c d e not same commits on both branches.

if want debug why might happening, useful post results of git log master..development, redacting information necessary.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -