5

I am tracking my home dir in a repo, with lots of ignores. I have just modified my .bashrc and git does not realize about it. That means that:

  1. .bashrc is being ignored: no, since it is not in the .gitignore
  2. it is set as assume-unchanged (git update-index --assume-unchanged). According to this I can list those files, and it is not in the list.

I am out of ideas. What could be going on?

Community
  • 1
  • 1
blueFast
  • 41,341
  • 63
  • 198
  • 344
  • What is the location of `.bashrc` relative to the top level of the repo? Did you check _every_ `.gitignore` file? – Tim Biegeleisen Sep 21 '16 at 15:23
  • 1
    I am going to disappoint here, but the problem was that my .bashrc is actually a symlink to another file (which I track in another repo), and the symlink has indeed not changed. – blueFast Sep 21 '16 at 15:26
  • There isn't really much to it - if the change doesn't appear, the file must be either ignored or your change is already commited. For the first case you can use `git add -A` as @phaberest pointed out in their answer and for the second case you can backup your file, do `git reset --hard` and then check if your file got reset. If it did, try adding it now. – Dunno Sep 21 '16 at 15:26
  • 1
    The fact that this was a symlinked file changes things. – Makoto Sep 21 '16 at 15:32
  • Possible duplicate of [How does git handle symbolic links?](http://stackoverflow.com/questions/954560/how-does-git-handle-symbolic-links) – Makoto Sep 21 '16 at 15:32
  • In essence, [this particular answer](http://stackoverflow.com/a/18791647/1079354) may shed more light on the matter. – Makoto Sep 21 '16 at 15:32
  • 1
    @Makoto: sure, but I didn't remember it was a symlink, and listing the files in the homedir is something it does not usually help because there are so many of them. So I do not usually do it, specially for hidden files. And having .bashrc be a symlink is something really strange (I do that because of historical reasons). So it was not an obvious catch. Leason learnt: if it is not ignored, and not assume-unchanged, the content has changed and git does not notice, it is probably a symlink. – blueFast Sep 21 '16 at 15:36
  • Something I learn today too, nice to know! – phaberest Sep 21 '16 at 15:38

1 Answers1

1

git add .bashrc should help.

If you specify the file you want to add instead of just git add -A will add it even if it is ignored.

phaberest
  • 3,140
  • 3
  • 32
  • 40