0

The problem we're facing is simple, I'm just not sure how to properly handle it. We have a branch that re-organized files and we're ready to merge master into that branch. The problem is that by now master has changed quite a bit.

Ex:

Master:
- file1
- file2
- file3

Our branch:
- directory1/file1
- directort2/file2
- directroy3/file3

How do I tell git the new location of the files so that the auto-merge can work properly?

Thanks.

Binary Logic
  • 1,529
  • 2
  • 17
  • 19
  • If they contain similar contents, Git should be clever enough to figure that out by itself. – knittl Nov 02 '12 at 18:40

2 Answers2

0

You should always move files using the git mv command to ensure that the new file structure is tracked properly. git can handle the merging as long as it is aware of which files are which.

mattc
  • 485
  • 3
  • 9
  • Git does not record rename information in its commits. It only detects them during log (or merge) – knittl Nov 02 '12 at 18:44
  • I stand corrected, was assuming git and mercurial operated the same in this regard. just found this link: http://stackoverflow.com/questions/1094269/whats-the-purpose-of-git-mv – mattc Nov 02 '12 at 18:47
0

I've run into this before and it can be a pain. This isn't really a solution but one way to make it less painful is to frequently rebase the branch against the Master.

Upgradingdave
  • 12,916
  • 10
  • 62
  • 72