2

I have a project that I recently added to Git and I can't seem to locate my .gitignore file. Anyone know where it should be? And if it's missing, how to get it back?

The Hungry Androider
  • 2,158
  • 5
  • 24
  • 45
  • 2
    [This question](http://stackoverflow.com/questions/8476376/typical-gitignore-file-for-an-android-app?rq=1) and [this question](http://stackoverflow.com/questions/10744305/how-to-create-gitignore-file?rq=1) might help. – legoscia Jul 04 '14 at 22:34
  • Thanks legoscia, found my answer by digging in the second link. – The Hungry Androider Jul 04 '14 at 22:37

1 Answers1

2

If files are ignored, but you don't find any .gitignore, then those ignore rules can by in other spots specific by gitignore man page:

  • $GIT_DIR/info/exclude
  • file specified by the configuration variable 'core.excludesfile'.

If you think a file is ignore, but you don't know by which ignore file, you can type:

git check-ignore -v yourFile
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • Is `check-ignore` an alias? I get `git: 'check-ignore' is not a git command. See 'git --help'.` – Miserable Variable Jul 14 '14 at 14:34
  • @MiserableVariable you need git 1.8.3.3+ (preferably 1.8.5+) for git check-ignore (http://git-scm.com/docs/git-check-ignore) – VonC Jul 14 '14 at 14:35
  • Thanks. My cygwin64 git is at 1.7.9 so I guess I got to wait a little bit. – Miserable Variable Jul 14 '14 at 18:40
  • @MiserableVariable ok, but why use cygwin at all for Git? Msysgit works just fine: https://github.com/msysgit/msysgit/releases/. http://stackoverflow.com/a/784743/6309 and http://stackoverflow.com/a/3144417/6309 – VonC Jul 14 '14 at 19:24
  • Because I have been using cygwin for a long time :) the rest of msys is very old – Miserable Variable Jul 14 '14 at 19:51
  • @MiserableVariable regarding git, it has been a few years that Cygwin is no longer useful. And Gow is recent enough: https://github.com/bmatzelle/gow/wiki – VonC Jul 14 '14 at 19:58
  • Thanks for the follow up. I know about cygwin limitations but after 20 years using cygwin and 25 years using emacs I don't know if I can handle the learning curve -- those backslashes are slippery :) – Miserable Variable Jul 14 '14 at 22:50
  • Thanks to this discussion I found http://sourceware.org/cygwinports/ and now I am 1.8.5.5. Thank you! – Miserable Variable Jul 15 '14 at 15:25
  • 1
    @MiserableVariable Great! That should improve the situation. – VonC Jul 15 '14 at 15:26