nafur
nafur

Reputation: 181

git merge omits files within ignored folder?

I have a branch that contains a folder resources/ that is in the .gitignore. However, within this folder are a few files that are managed by git. (We use this for 3rdparty-libraries that we compile ourself and want to have the sources in our git)

Now we merged this branch back to the master (git merge <branch>) and these files have not been "transfered" to the master. Since we didn't notice this immediately, redoing the whole merge (after removing the whole folder from .gitignore) would be a lot of work.

I already tried removing it and merging again. This does not work, as the respective commits have been merged. I also tried cherry-picking the commits for this folder, but this resulted in lots of merge conflicts.

Is there any way to fix this?

Upvotes: 1

Views: 70

Answers (1)

  1. Perhaps that folder should not be ignored. or it should have a .gitignore file of its own where files that are not supposed to be ignored should be added to instead.
  2. If you know which file you need could no just go to master and do git checkout {branch_with_your_files} {filenames}

Then add and commit those files ?

or maybe i am not understanding your problem :)

Cheers Rasmus Voss

Upvotes: 1

Related Questions