git Eclipse 霓虹灯“无暂存文件”错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39288753/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 12:14:26  来源:igfitidea点击:

Eclipse neon "no staged files" error

eclipsegitgithub

提问by Zuenonentu

I am using Eclipse Neon for Github, to be able to push changes.

我正在为 Github 使用 Eclipse Neon,以便能够推送更改。

I already have a Github account and made a specific repository just for trying, but nothing ends up in the repository, though I follow guides and do exactly the same without getting any errors, but ending up with an empty Github repository (except for the Readme file that I created along with the repository at the website).

我已经有一个 Github 帐户并创建了一个特定的存储库只是为了尝试,但存储库中没有任何结果,尽管我按照指南并完全相同而没有出现任何错误,但最终得到一个空的 Github 存储库(自述文件除外)我在网站上与存储库一起创建的文件)。

I've made several Java Projects with a simple mainmethod, and a method for just writing a dummy message, simple, but doesn't exist in repository.
Then I right click the project, select Team-> Share Projectand select:
Repository: NewGit - /home/jannik/NewGit.git, working tree: /home/jannik/NewGitand Path within repository: dummyand click my dummy project and press finish.

我已经用一个简单的main方法制作了几个 Java 项目,还有一个只编写虚拟消息的方法,很简单,但在存储库中不存在。
然后我右键单击该项目,选择Team-> Share Project并选择:
Repository: NewGit - /home/jannik/NewGit.git工作树:/home/jannik/NewGit存储库中的路径:dummy并单击我的虚拟项目和按完成。

Now I right click my project again and choose Remote-> Pushand choose the default option called Configured remote repositorywhich says origin: https://github.com/< my-github-account>/eclipseTest.gitwhich tells me that it links to my repository named eclipseTest (which I made on website).

现在我再次右键单击我的项目并选择Remote-> Push并选择名为Configured remote repository的默认选项,上面写着origin: https://github.com/< my-github-account>/eclipseTest.git这告诉我它链接到我的名为 eclipseTest 的存储库(我在网站上制作的)。

I then press Next and press *Add all Branches specand clicks next, and then Finish. I then get a dialog saying that Master and NewGit branches are up-to-date, though my dummy project is missing.

然后我按 Next 并按*Add all Branches spec并单击 next,然后单击 Finish。然后我收到一个对话框,说 Master 和 NewGit 分支是最新的,尽管我的虚拟项目丢失了。

If I try the Commitoption in Eclipse, I get an error saying that there're no staged files

如果我在 Eclipse 中尝试Commit选项,我会收到一条错误消息,指出没有暂存文件

What am I doing wrong?

我究竟做错了什么?

回答by VonC

Before being able to push anywhere, you need to add and commit first.

在能够推送到任何地方之前,您需要先添加和提交。

See "EGit/User Guide/Commit" for adding and committing.

添加和提交参见“ EGit/用户指南/提交”。

Its Track Changessections shows how to add files to the index.

它的Track Changes部分显示了如何将文件添加到索引中。

Click Team > Add to Indexon the project node. (This menu item is named Addon older versions of Egit.)

单击Team > Add to Index项目节点。(此菜单项Add在旧版本的 Egit 上命名。)

Then:

然后:

Click Team > Commitin the project context menu.

Click Team > Commit在项目上下文菜单中。

Finally, you can push.

最后,您可以推动。

回答by madhangopal

go to >Theam > commit > you will get the changed list of files and in those you can move changed files to staged changesblock and then commit.

转到 > Theam > commit > 您将获得更改的文件列表,在这些列表中您可以将更改的文件移动到暂存更改块,然后提交。

See this image you can find the solution:

看到这个图片你可以找到解决方案:

enter image description here

在此处输入图片说明