0

Working on a repository, I had to fetch. I add the modified files, create a commit, then pulled, to obtain an error. One file wasn't added and committed, even if I added it : it was still displayed with a git status as modified.

Here all the commands I tried. Nothing worked :

  • git add file
  • git rm file
  • git checkout file
  • git stash
  • cd ../ && rm -rf repository && git clone repository
  • brew uninstall git && brew install git

I also try every solution posted here : git status shows modifications, git checkout -- <file> doesn't remove them still no changes (even if I may have miss understood how we implement gitattributes).

When exploring the repository (cd and ls), the file doesn't appear in the folder where it is supposed to be, so it doesn't exist. The file is generated from middle man (slate documentation). We add them because we only use middle man on dev, so we have to push them on git to have them on prod. The file exists on the git platform we use. I tried to copy it in the repository. Still no changes.

I want to be able to fetch and merge. Having this file always visible in the git status make the message "Please commit your changes or stash them before you merge."appear each time and abort the process.

Here are the main tools we use

  • ruby version : 2.3.1
  • IDE : atom
  • Git version : 2.10.2
  • The two other people who work on this project use linux Mint.

Thank you !

Community
  • 1
  • 1
Aridjar
  • 301
  • 1
  • 5
  • 14
  • What do you want to do? Do you want to remove the file? If so then what does `git status` show? Is the file staged? – pratZ Nov 16 '16 at 10:40
  • I want to be able to fetch and merge. Having this file always visible in the git status make the message "Please commit your changes or stash them before you merge."appear each time and abort the process. I edited the post to be more clear. – Aridjar Nov 16 '16 at 11:15
  • Did you commit after `git rm file`? – pratZ Nov 16 '16 at 11:23
  • Yes, I did. Still the same result after. – Aridjar Nov 16 '16 at 11:25
  • Ok. I think you got that error after the merge. May be you are in between a merge. `pull -> fetch + merge` – pratZ Nov 16 '16 at 11:34
  • I don't see how I could because on of my test was : `cd ../ && rm -rf repository && cd repository && git clone repository && git status`. The file was still printed as modified but not added. – Aridjar Nov 16 '16 at 12:43
  • check end-of-line git configuration – Ivan Nov 16 '16 at 17:48

0 Answers0