我创建了一个本地仓库 将整个文件夹移到了仓库里 但是add完以后 git status查看时出现以下情况
这是仓库的样子
git commit后也是这样
求大神告诉我这是什么情况
我创建了一个本地仓库 将整个文件夹移到了仓库里 但是add完以后 git status查看时出现以下情况
这是仓库的样子
git commit后也是这样
求大神告诉我这是什么情况
需要这样使用
git status
查看修改状态
git add dapingmu
添加 或者使用 git add .
添加全部
git commit dapingmu -m 'some changes'
来添加说明git commit
可以批量修改
git push
提交修改
git帮助文档对--all
选项是这样说的:
Update the index not only where the working tree has a file matching <pathspec> but also where the index already has an entry. This adds, modifies, and removes index entries to match the working tree.
If no <pathspec> is given when -A option is used, all files in the entire working tree are updated (old versions of Git used to limit the update to the current directory and its subdirectories).
大致意思是该选项会提交所有修改,包括添加、修改和删除,但是如果未指定路径的话,会提交工作树下的所有文件。
注意最后在括号中的一句话:
old versions of Git used to limit the update to the current directory and its subdirectories
即老版本的git会限制对当前目录和它的子目录的更新。
所以,我觉得可能是你的git版本比较老,建议如果只是将新添加的文件加入到暂存区的话,可以使用git add .
。如果想要将删除加入到暂存区的话,使用git add -u
。
2 回答2k 阅读
2 回答2k 阅读
1 回答1.4k 阅读✓ 已解决
3 回答861 阅读
你应该是
git add --all
以后 修改了 dapingmu 内的文件了 所以显示和你图内的一样每次修改文件后都需要 stage 目标文件的 不然是不能commit 的
如下操作 获得返回结果和题主一样: