私はgitのを勉強していますし、this exerciseに来た:はなぜ学習運動は、Gitは-amはgitのは明らかにこれを追加していてもリポジトリに私の新しい.gitignoreを追加するには不十分であるコミットと警告していますか?
リポジトリに
.gitignore
ファイルをコミットします。ヒント:Runninggit 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
は十分ではありませんでしたか?