threads / discuss / 15191

new file missing after resolving rebase merge conflict

Subject: new file missing after resolving rebase merge conflict

## tl;dr

One message between Aug 24, 2008 and Aug 24, 2008.

replies: 0people: 1as markdown or json

Benny Halevy· Aug 24, 2008, 17:20 UTC · lore
with git version 1.6.0

When rebasing a branch onto another (command was git rebase --onto newbase newbase.orig branch) I've hit a merge conflict in one of the patches that among other things, adds some new files to the tree. After resolving the conflict and running git add on the resolved files I ran git rebase --continue and in a later patch, when trying to compile I noticed that one of the files that the former patch was supposed to add is missing from the tree and from the index.

I'm not sure it's relevant, yet this file is the last hunk in the patch.

Anyhow, the file still appears with git show of the rebased patch:

$ git show 39fe203 ...

diff --git a/include/linux/pnfs_xdr.h b/include/linux/pnfs_xdr.h
new file mode 100644
index 0000000..1f811c5
--- /dev/null
+++ b/include/linux/pnfs_xdr.h
@@ -0,0 +1,137 @@

but it doesn't appear to exist in the index:

$ git checkout include/linux/pnfs_xdr.h
error: pathspec 'include/linux/pnfs_xdr.h' did not match any file(s) known to git.

only after explicitly re-checking it out from the former patch:
$ git checkout 39fe203 -- include/linux/pnfs_xdr.h

it comes to existence.

Benny

← back to recent threads