1

I have a submodule. I updated a branch, say "x" and committed. Now, I need to update the same changes in branch "Y" which has some difference from X.

So here is what I have been doing, I checkout Y and then run git merge X. Now, there are conflicts. Some of the conflicts are not to be resolved, for example change-logs etc. So the changelog file that I have, debian/changelog is shown to have conflict and another file has a conflict.

What I want to do is, not update debian/changelog while keeping other changes. Please dont down vote at this point. I have been trying a lot of things and read git rm man page as well.

I tried doing this, git rm --cached debian/changelog and it adds it to the list of changes to be committed as deleted. This is causing worry as I dont want this to be deleted on the remote git repository. Please advise.

SeattleOrBayArea
  • 2,808
  • 6
  • 26
  • 38

1 Answers1

1

Generally, in order to ignore a specific file durng merge (whille keeping that file versioned ion Git), you would set a merge driver with, in this case, a "keepMine" script.

No need for git rm. That script will make sure, in case of conflict for any *.log file (for instance) to always keep the destination file (ie the one one branch Y).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • my question is not just for merge. I want to know how to remove the file from my index. Next time it may be a different file and then I need to use this command. But, I will use the keepMine script for some of the merges that are more of manual job. thank you. – SeattleOrBayArea Mar 21 '12 at 05:15