2

I am trying to add a specific untracked file for the next commit in the local repository with git add myfile. When I do, it behaves like if it worked (no output). But, if I execute git status, the file is still untracked. The file itself is nothing esoteric, just a python script. This failure didn't happen with other python scripts in the same branch.

I've searched for similar questions in StackOverflow as far as I was able to, this is the most similar I could find: Why git add -A didn't add these files? But, this case is significantly different from mine. I also found this bug report on Google, but I wasn't able to understand the only answer to that bug issue.

I am using git 2.1.0 in Ubuntu 14.04. I moved the repository several weeks ago to another machine following @bdonlan 's answer in How to migrate GIT repository from one server to a new one: "Copy it over. It's really that simple. :)". Everything worked fine until now, except this issue.

Is there a way to find out why is this happening?

SebasSBM
  • 860
  • 2
  • 8
  • 32
  • 1
    Whats the name of the file? Does this happen with another newly created file with the same name? Does it happen with a newly created file with the same content as the existing one? – Th 00 mÄ s May 21 '15 at 10:04
  • Maybe you have permissions/user problem? – Nikolai May 21 '15 at 10:04
  • @Nikolai No. The permissions were the same for other python scripts, and they were added successfully. – SebasSBM May 21 '15 at 10:10
  • @ThomasS I don't know why you are asking for the filename actually, but the only special char it has (just in case the information may be useful) is a "_" used twice. But this char was used in other files that were succesfully added to commit. – SebasSBM May 21 '15 at 10:13
  • 1
    Indeed, try to add same file with a different name. Or same file in a different path. – Nick Volynkin May 21 '15 at 10:28
  • Casually, I was having the same idea right now. I'll give it a try. – SebasSBM May 21 '15 at 10:29
  • Could the filename have gained a space or other unprintable character (or even a unicode char)? Maybe you should quote the filename just to be sure. – Philip Oakley May 21 '15 at 12:59
  • who knows, maybe they were Unicode... anyway it ts strange, the name just used english letters, the "_" char and numbers. Anyway **changing the name fixed the problem**, and the only thing I did was just adding a char to the previous name. Thank you. Maybe you want to post it as an answer.... – SebasSBM May 26 '15 at 10:37
  • Something very strange keeps happening: now I can add the file to a commit, but the old name is still in the list of untracked files... – SebasSBM May 26 '15 at 10:43
  • Do you have a .gitignore file? If so, what is in it? – Wolf May 27 '15 at 15:33
  • Yeah, I made a .gitignore to prevent the tracking of *.pyc and *.pyo files. – SebasSBM May 28 '15 at 11:27

0 Answers0