您的位置:首页 > 其它

git commit 失败"Untracked files,Changes not staged for commit" 问题的解决

2016-10-17 11:46 549 查看

问题描述

$ git commit
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
(use "git push" to publish your local commits)
Changes not staged for commit:
modified:   SUMMARY.md

Untracked files:
mcloudv2/

no changes added to commit


git commit之后,提示git commit失败,提示Untracked files,Changes not staged for commit。也就是说,这个文件在commit之前需要先把文件放入暂存区。

这里有一句(use “git push” to publish your local commits),试一下git push,并不管用

问题解决

解决的办法很简单,只需要在commit之前add一下文件即可。

$ git add SUMMARY.
fatal: pathspec 'SUMMARY.' did not match any files


然后再commit一下就没有问题了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  git
相关文章推荐