问题描述
记得之前在安装完Git之后,按照下面的操作步骤,向本地仓库提交文件,是没毛病的:(切换到对于项目下,即仓库下,我的是test)
1.git add bb.md
2.git commit -m'my second commit'
然后在本地仓库test下就成功创建了aa.md文件。

搞得我一脸懵逼!!!
解决方案
第一种方法:
1.手动创建文件bb.md
2.git add bb.md
3.git commit -m'my second commit'
于是捣鼓了一会发现,原来需要我们先手动在项目文件下,创建文件bb.md。然后再执行上面的两条命令。这样就能成功的添加了!具体原因目前我也没搞明白,不过算是找到了解决方法吧!

第二种方法:
1.git touch bb.md
2.git add bb.md
3.git commit -m'message'

希望对你有所帮助!
网友评论