Basically when i want to commit two separate changes in the same file that resulted from an git add --patch <file>
operation, git svn rebase later on throws 1-2 conflicts upon comitting the second change when using git add
for the second change.
so i'm basically doing this (i'm on master branch and have fetched the svn repository):
git checkout -b feature
... make two unrelated changes to file test.txt...
git add --patch test.txt
... add first change but ignore second one
git commit -m "change1"
git stash
git checkout master
git merge feature
git svn rebase
git svn dcommit
git checkout feature
git stash apply
now here there's two ways to do it, first the one that works:
git add --patch test.txt
... select everything (which is the second change in this case)
git commit -m "change 2"
git checkout master
git merge feature
git svn rebase
git svn dcommit
here's the one that doesn't work:
git add test.txt #notice there's no --patch
git commit -m "change 2"
git checkout master
git merge feature
git svn rebase #yields a conflict
So why is it that when using git add --patch
for the second change, I can commit to the svn repository without problems, but when just using git add
for the second change, it results in a conflict? I'm quite new to git, so this might be a stupid question, but as I see it, both commandsets should do exactly the same.