Я учусь мерзавца и пришли к this exercise:Почему учебное упражнение предупреждает, что git commit -am недостаточно для добавления моего нового .gitignore в репозиторий, хотя git явно добавил его?
Commit файл
.gitignore
в репозиторий. Подсказка: Запускgit commit -am
не достаточно. Почему нет?
Я сделал git commit -am
и этого, кажется, достаточно.
[email protected]:~/repos/website$ git status
On branch master
Your branch is up-to-date with 'origin/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)
deleted: breaching_whale.jpg
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")
[email protected]:~/repos/website$ git add .
[email protected]:~/repos/website$ ls
images index.html README.md
[email protected]:~/repos/website$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: .gitignore
deleted: breaching_whale.jpg
[email protected]:~/repos/website$ git commit -am "Add gitignore"
[master e7cc08c] Add gitignore
2 files changed, 1 insertion(+)
create mode 100644 .gitignore
delete mode 100644 breaching_whale.jpg
[email protected]:~/repos/website$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
Не могли бы вы спекулировать на том, что я сделал неправильно, и помочь мне понять, что подразумевается в учебнике и почему git commit -am
не хватает?