0

I'm trying to add a .gitignore to a large repository.

I pulled the branches into a new local repository containing only the visualstudio.gitignore file ('master'), checked out the oldest branch (that all other branches depend on = 'rootBranch') and tried to run git rebase using git rebase master (while being on rootBranch)

I thought this would add the .gitignore as the "base" and then stack every other commit in rootBranch on top of it. But now I'm getting multiple conflicts, in multiple commits and sub-branches, VisualStudio telling me "both modified" even though the only change is an added .gitignore (which shouldn't affect the files that have conflicts).

How is this even possible? I make no changes to the code that aren't already known, how could I have conflicts there? The repository used to be a TFVC TeamProject, maybe the automatic conversion using git-tfs made some kind of illegal change that becomes apparent only now during the rebase?

Vaethin
  • 316
  • 4
  • 18
  • Please provide a minimal example of your problem, with the exact codes you have executed. You say you ran git rebase rootBranch. Which branch were you on while executing that command? – mfnx Aug 28 '19 at 08:02
  • A merge between two branches merges the final changes of the two branches, a rebase replays commits one by one. Whereas a merge might not introduce a conflict, a rebase can. It depends on the content of the branch you rebase on. However, it seems to me you tried to rebase *onto* rootBranch, instead of your new master. Can you explain in details the state of your repository, the branches involved, the commands involved, etc.? – Lasse V. Karlsen Aug 28 '19 at 08:25
  • Sorry, Typo, I'm using `git rebase master`. I'll provide an example of the type of conflict i'm getting in a moment – Vaethin Aug 28 '19 at 08:45
  • https://i.imgur.com/ttMNVIw.png This is an example of the type of change that fails when trying to rebase. Completely standard stuff, but it doesn't fail always either :/ – Vaethin Aug 28 '19 at 08:48

0 Answers0