Eugene msc
Eugene msc

Reputation: 380

Netbeans fails to merge because of ignored files

I try to merge my git repository with a remote one and what i get is this:

Merge Result: Failed Merge of HEAD with remote-rep/master failed because of these files: /path/to/some/file.jpg

The whole folder that file is in is shown as ignored by git. I checked it in .gitignore and it is there. Those files have never been added on commit also.

Upvotes: 1

Views: 5349

Answers (2)

Karthik Bose
Karthik Bose

Reputation: 36084

The file could have been added by others in the remote repo. If you really think the file must be ignored, then do this.

  1. Move the file (local) to some other location.
  2. Merge the remote repo with your master.
  3. Untrack the file. git rm /path/to/some/file.jpg
  4. Commit and Push.
  5. Move back your local file to the previous location.
  6. Inform your colleagues about this change. ;-)

The best way to avoid this issue is by committing .gitignore file. So that everyone shares same .gitignore file.

Upvotes: 2

53iScott
53iScott

Reputation: 857

Please try git command in shell instead of the options in Netbeans. You will see the difference!

Upvotes: 0

Related Questions