Patch does not apply after merging

Using the tool git flow, I created a function branch (forked dev), made a bunch of changes, and merged the branch onto dev.

There is a file that I changed in the function branches. I can confirm that the revision (let it be called REV-A) that modifies the file ( FILE-A) is present and applied to the function branches.

However, after the merge FILE-Ais in the initial state (pre-merge) on the branch dev. I see REV-Awhen I do git logon dev, and if I follow the lines created git log --graph, I can trace this commit forward with a merge commit, where I combined my function branch with dev.

However, when I do a git blameof FILE-A, the commit does not exist, and the corresponding line is in the original (pre REV-Acommit).

In addition, the git show REV-A | patch -p1correction is applied cleanly. After that git diffit looks the same as git show REV-A.

What's happening? How is it that merging introduces revision into the history of branches, but does not actually apply it? Are there any other changes from this merge that are not applicable?

+4
source share
2 answers

, , , - git diff . :

git diff $merge^1...$merge^2 -- FILE-A  # `$merge^2` was `feature` as of the merge
                                         # `$merge^1` was `dev`

, , diff, , , , .

, REV_A REV_A , ( ), , , git revert.

, , , .

+2

, ? , , . , "" . , git flow feature finish my_feature?

, , . , , , .

MBP:git-test acanby (master)$ echo "Original Code" > file.txt
MBP:git-test acanby (master)$ git commit -am "First commit"
MBP:git-test acanby (master)$ git flow init
MBP:git-test acanby (develop)$ git flow feature start my_feature
MBP:git-test acanby (feature/my_feature)$ echo "New feature here" >> file.txt 
MBP:git-test acanby (feature/my_feature)$ git commit -am "Feature change"
MBP:git-test acanby (feature/my_feature)$ git flow feature finish my_feature
MBP:git-test acanby (develop)$ git blame file.txt 
  ^d96c279 (acanby 2015-02-16 20:36:22 +1100 1) Original Code
  62a38725 (acanby 2015-02-16 20:38:37 +1100 2) New feature here
MBP:git-test acanby (develop)$ git log --oneline
  62a3872 Feature change
  d96c279 First commit

, git -flow.

git -flow (, , , ), - .

+2

All Articles