我正在尝试将一些更改从cloud9推送到github存储库,但遇到了障碍。
我可以使用ssh克隆OK,一切似乎都正常,我进行了更改,将更改保存在cloud9中(当我返回时,更改仍然在那里),然后我执行git commit并获取:
no changes added to commit (use "git add" and/or "git commit -a")但我只需要提交对现有文件的更改,而不是添加。因此,很明显,当我尝试git push origin master时,没有什么需要推送的。
我尝试了多个github repos,我得到了相同的结果。
我遗漏了什么?
感谢任何人的帮助!
附言:哦,顺便说一句,我的git很烂
发布于 2011-09-09 06:33:38
该消息显示您没有添加要提交的已更改/跟踪的文件。
尝试使用-am开关在一个操作中添加和提交:
git commit -am "your message goes here"
git push发布于 2011-09-09 07:03:59
Git将提交与添加更改分开。首先,您必须添加希望出现在提交中的所有更改:
#1: Add any new files as part of the commit
# or use git add -p to interactively select hunks to stage
git add file1 file2 …
#2: Commit to local
git commit -m "Commit message goes here"
#3: Push your commit/changes to the host (github)
git push现在,您应该将所有更改都放在github上。
或者,您可以在一行中执行提交和添加/修改,这可能会将不需要的文件包含到您的变更集中。
#1 Add files commit to local
git commit -a -m "Commit message goes here"
#2 Push your commit/messages to the host (github)
git pushhttps://stackoverflow.com/questions/7355277
复制相似问题