Существует множество команд git, в которых можно указать имя файла. Похоже, они не работают правильно в моем проекте, потому что эти команды по-прежнему применяются ко всем файлам вместо одного.
Примеры:
git add <file> # causes adding all files to the stage, not just one
git checkout <file> # discard all changes
git log -- file # works as usual git log command
git blame <file> # this one seems to work right
Я что-то не так делаю или что-то не так с моим мерзавцем? Как я могу это исправить, особенно проблема git add file
?
Подробный пример git add <file>
:
$ git status
On branch master
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: file1
modified: file2
modified: file3
$ git add file1
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: file1
modified: file2
modified: file3