EGIT branches local vs Remote tracking

心不动则不痛 提交于 2019-12-21 05:18:14

问题


I am new to GIT. I use EGIT with eclipse.

I have a question about branches where I see two sections "Local" and "Remote Tracking". If I have to work on one of the branches, I think there are two ways I can accomplish it.

a) Check out origin/featureBranch under remote tracking and work on it.

b) Right click under local and create a local branch and point to ref/remote/featureBranch and start working on it?

Are there any difference between these two approaches? which one is preferred?


回答1:


b) would be best.
a) would create a DETACHED HEAD, which would allow you to work on an "anonymous" branch, but would not allow you to push your work.
(See also "Git Tip of the Week: Detached Heads" and "detached head explained" for more on detached head)

For EGit, see "Git Lesson: Be mindful of a detached head":



来源:https://stackoverflow.com/questions/8213826/egit-branches-local-vs-remote-tracking

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!