简体   繁体   English

如何将项目从Github同步到Eclipse

[英]How to sync project from Github to Eclipse

I have a Eclipse java project ( let's call it project X ) developed in computer A, then I push it to github ( only java files and some properties files). 我有一个在计算机A中开发的Eclipse Java项目(我们称它为X项目),然后将其推到github(只有Java文件和一些属性文件)。 I didn't upload .project file of eclipse because I might want to work with it in another computer B. So in computer BI created a blank project with the same name X. When I try to fetch the java files from Github, it complains "there are already some files in the directory" and refuse to download. 我没有上载eclipse的.project文件,因为我可能想在另一台计算机B上使用它。因此,在计算机BI中创建了一个具有相同名称X的空白项目。当我尝试从Github提取Java文件时,它抱怨“目录中已经有一些文件”,并拒绝下载。 What did I do wrong and what is the right way to code across different computer with help of Github? 在Github的帮助下,我做错了什么?在不同计算机上进行编码的正确方法是什么? Thanks. 谢谢。

Try first to clone in a new empty folder. 首先尝试克隆到一个新的空文件夹中。

Then add your new files in the cloned repository. 然后将新文件添加到克隆的存储库中。

That way, Git will accept the first step (clone) without complaining it could overwrite existng files. 这样,Git将接受第一步(克隆),而不会抱怨它会覆盖存在的文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM