I\'m trying to create a new git repository from existing folder. I\'ve created a .gitignore
file in the root of the folder. But if I say
git add
Your file must still be tracked, you can see by doing git status
that will show you that your file is modified even if it's in .gitignore
You need to do this:
git update-index --assume-unchanged [path_to_file]
Comment line as the first line of the file is critical! I spent considerable time trying to exclude files only to find that GIT was ignoring the first line in the ignore file.
Try "git add .
" instead.
Also, it works for me (on Linux):
$ git init $ echo foo > .gitignore $ echo foo > foo $ echo bar > bar $ git add -v * The following paths are ignored by one of your .gitignore files: foo Use -f if you really want to add them. fatal: no files added