use*_*081 9 git git-add git-commit
当我尝试git添加我的文件时,我输入了
git add <insert file names here>
Run Code Online (Sandbox Code Playgroud)
这工作正常.但是,当我尝试做的时候
git commit -a
Run Code Online (Sandbox Code Playgroud)
我的git存储库告诉我它是空的.输出的是:
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
<insert name of files here>
nothing added to commit but untracked files present (use "git add" to track)
Run Code Online (Sandbox Code Playgroud)
可能有人知道解决方案吗?谢谢.
Kyl*_*son 17
而且您可能还想确保自己位于项目的根目录中.我暂时在Rails项目上遇到了这个问题,然后意识到我在/config目录中.哎呦!#noobmistake
-a要git commit覆盖暂存区域("索引")的标志.看一下手册页的内容:
-a, --all
Tell the command to automatically stage files that have been modified
and deleted, but new files you have not told git about are not
affected.
Run Code Online (Sandbox Code Playgroud)
经验法则是在使用git commit时使用平原git add.该命令git commit -a适用于您希望提交存储库中的每个更改但不能打扰git add它们的时间.
PS.git add -A很有用:它会在工作树中添加所有未忽略的新文件
| 归档时间: |
|
| 查看次数: |
18506 次 |
| 最近记录: |