There is a file already committed.
I want to add the file .gitignore. I want to keep the file.
for example)
$ git ls-files
foo
$ echo "foo" > .gitignore
$ echo "test" >> foo
$ git status
# On branch master
# Your branch is up to date with 'origin/master'.
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: foo
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .gitignore
#
no changes added to commit (use "git add" and/or "git commit -a")
As you can see, foo file status changed to "modified". I want to be not modified status. How can I add foo file to .gitignore without deleting it.
Already answered is not what I wanted. What I want is not local setting. I want method each developers not using 'git update-index --assume-unchanged path/to/file.txt'