简体   繁体   English

EGit从GitHub克隆并推送到GitHub

[英]EGit clone from and push to GitHub

I have an Eclipse (CDT) project setup with EGit to commit to local master and push to github. 我使用EGit进行了Eclipse(CDT)项目设置,以提交给本地主服务器并推送到github。

So far I have been just using this setup to pretty mush act as cloud backup from my primary dev PC 到目前为止,我只是使用此设置从我的主要开发人员PC充当了云备份

But now I would like to be able to work on the same project on multiple PC's, but without having to fork the github repo. 但是现在我希望能够在多台PC上进行相同的项目,而不必派生github仓库。

I'll tell you now, I have tried several times to understand git further than the very basic basics but have always got lost in the terminology etc. 我现在要告诉你,我已经尝试了几次,比最基本的基础更深入地了解git,但是总是在术语等方面迷失了方向。

If I use EGit on the secondary PCs to clone the github repo, should I then be able to simply commit and push any changes there to GitHub as if I was still working on the primary PC, or will I have to pull/rebase/etc each time I need to do new work on either PC? 如果我在辅助PC上使用EGit来克隆github存储库,那么我是否应该能够像在主PC上一样继续在GitHub上提交任何更改并将其推送到GitHub,还是必须拉/重新设置/等每次需要在两台PC上进行新工作时?

I think I did try to set this up before but ended up with two master repos somehow... 我想我确实曾经尝试过进行设置,但最终还是以某种方式获得了两个主存储库...

So turns out I simply need to CLONE the project to begin with, make any changes the COMMIT and PUSH. 因此,事实证明,我只需要克隆项目即可,对COMMIT和PUSH进行任何更改。

Then on another PC, if I already have a clone, PULL (or FETCH and MERGE) the changes, make any new changes then COMMIT and PUSH again. 然后在另一台PC上,如果我已经有一个克隆,则对更改进行PULL(或FETCH和MERGE)合并,进行任何新更改,然后再次进行COMMIT和PUSH。

This way each local repo has a clone and the user needs to ensure they have the most recent changes pulled from the remote repo before starting adding new changes 这样,每个本地存储库都有一个克隆,用户需要确保在开始添加新更改之前,他们已从远程存储库中提取了最新的更改。

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

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