Git 提交是不可能的。没有暂存文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38611124/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git commit not possible. There are no staged files
提问by Simon Kiely
I am using EGits with Eclipse and running into some issues.
我在 Eclipse 中使用 EGits 并遇到了一些问题。
I have one change from head; I have made one new class.
我的头有一个变化;我做了一门新课。
When I right click on this class and click "push", the following dialog shows and I cannot get past it :
当我右键单击这个类并单击“推送”时,会显示以下对话框,但我无法通过它:
Anyway, I need to push this file because I can't commit in real life, and now I cannot commit in Eclipse either and it's taking it's toll mentally.
无论如何,我需要推送这个文件,因为我无法在现实生活中提交,现在我也无法在 Eclipse 中提交,这在精神上造成了损失。
Thanks.
谢谢。
PS I have googled this extensively looking for an easy fix (like a "stage" button) and found nothing.
PS我已经广泛搜索了这个寻找一个简单的修复(如“舞台”按钮),但一无所获。
采纳答案by Anil Kumar
using EGit: Right click it and navigate to Team => Add.
使用 EGit:右键单击它并导航到 Team => Add。
after then Push the code
然后推送代码
Before pushing the file add that new file on git using terminal
在推送文件之前,使用终端在 git 上添加该新文件
git add after then
git add 然后
git push origin branch
git push origin 分支