EGit本地与远程存储库 [英] EGit Local vs. Remote repositories

查看:122
本文介绍了EGit本地与远程存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很喜欢git,我正在围绕我应该使用git和egit的方式。从egit教程中,我已经在GitHub上设置了一个命令,将我的Eclipse项目从我的本地工作区推送到远程GitHub仓库,我可以将更改推送到GitHub,切换分支,查看GitHub上的更新等。这一切都是有道理的。查看Git Repository资源管理器,我有一个本地分支列表,没有远程跟踪分支,我没有列出远程记录。当我从本地分支机构创建一个分支机构时,egit对话框表示您正在创建一个基于本地分支的分支机构,并建议我应该从远程跟踪分支机构进行分支。



所以我的问题是,我正确地使用egit吗?



我应该继续将更改推送到远程GitHub存储库吗?如果是这样,一旦我共享项目和其他开发人员克隆存储库并开始对远程存储库进行更改,会发生什么?



或者我现在可以通过克隆我最初从我的工作区创建的现有GitHub存储库来ub本地存储库并设置一个新的远程存储库?



或者我是否为我现有的git仓库创建一个新的Push和FetchRemote?



还是别的?



困惑。

解决方案

对远程跟踪分支有很好的了解。



您可以创建多个本地分支(即分支,你不必要推送任何地方)如你想/需要。



但是,如果你不看任何远程分支,也许你没有获取GitHub回购首先:请参阅获取


I'm new to git and am wrapping my head around how I'm supposed to be using git and egit. From the egit tutorial, I have setup a respository on GitHub, pushed my Eclipse projects to the remote GitHub repository from my local workspace, I can push changes to GitHub, switch branches, see the updates on GitHub, etc. This all makes sense.

Looking at the Git Repository explorer, I have a listing of "Local" branches and have no "Remote Tracking" branches and I have no "Remotes" listed. When I create a branch from a local branch, the egit dialog indicates "You are creating a branch based on a local branch" and suggests that I should be making a branch from a remote tracking branch.

So my question is, am I correctly using egit?

Should I just continue pushing changes to the remote GitHub repository? If so, what happens once I share the project and other developers clone the repository and start making changes to the remote repository?

Or should I now ditch the local repository and setup a new remote repository by cloning the existing GitHub repository that I initially created from my workspace?

Or do I create a new Push and Fetch "Remote" for my existing git repository?

Or something else?

Confused.

解决方案

The "Branching" section of the Egit User Guide can help:

There is no obligation to create a local branch which would be named like a remote tracking branch (see "Having a hard time understanding git-fetch" to have a good understanding of "remote tracing branches).

You can create as many local branches (i.e. branches that you won't necessary push anywhere) as you want/need.

But if you don"t see any remote branch, maybe you didn't fetch that GitHub repo in the first place: see Fetching.

这篇关于EGit本地与远程存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆