version control - Commit changes missing from git merge -
i have 2 branches, a) develop , b) feature
i work on b, , ready merge b a. has had lot of work done, lot of other feature branches merging in via pull requests. pull latest head of , testing purposes, let's merge in b (note, same behavior going both directions, i'm trying figure out problem is).
i merged in b, have lot of compiler errors after resolving merge conflicts. noticed there code included in not making on b. causes build fail, , there many things missing (it's @ least 1 large commit's worth of code).
i tracked down commit i'm having issues "merging" b. it's not it's not merging though, see when type "git log" when b checked out after merge. reason actual changes associated commit disappear. there no merge conflicts regarding code in question, , i'm never touched section while working on b else happen.
regarding "missing" commit (even though see in branches log), supposed recover actual changes? use diff tool, i'm worried symptom of larger problem , other code i'm unaware of missing.
i'm new git, i'm little unsure of how approach this. please let me know if there's other information useful.
what i've tried far:
merging in b, commit there code commit not merging b a, same issue same code/commit
i've tried rebasing, branches off many commits many conflicts. commits on server i've read may bad idea. please let me know if should try rebasing in direction (a->b or b->a).
solution
if it's 1 commit that's missing can apply branch issuing cherry-pick command whilst being on b branch:
git cherry-pick commit_name
this command takes specific commit (by name) , applies current branch new commit. check name of commit in log , paste argument.
here more information on command: https://git-scm.com/docs/git-cherry-pick
more on probable cause
as problem itself. there may numerous reasons why experiencing such situation, of may trivial, not. i'd it's probable git sees differences, reason comes conclusion should not applied (during auto-merge process). have check history of b branch, how , when (with regards commit) created , have history specific commit.
anyway, if changes commit not physically present in b code, cherry-pick should solve apply these changes new commit name avoiding problems.
Comments
Post a Comment