简体   繁体   中英

Git branching messed up

I'm using Egit on Eclipse Mac and PC to sync a project that has three branches:

master
dev
rendersystem

I've created the project on the Mac and when I created the two branches dev and rendersystem I've used revs/heads/master as the Source ref and as Pull strategy I've used Merge.

Now I've switched to my PC and imported the project with Egit incl. all three branches. But if I change to dev or rendersystem branch it tells me that these branches are remotely tracked (in Branches dialog, Remote Tracking /origin/dev and /orginin/rendersystem).

If I check out dev or rendersystem branch and change my code, then commit it and try to push it to Github, it doesn't push the dev or rendersystem branches, only the master it pushed.

My question is now: How do I change the dev and rendersystem branches so that they are in a state where I can push them to Github from my Mac and PC?

Sorry if this question sounds confusing, but Git is one hell of confusing for beginners.

Remote tracking branches are read-only in git, as they represent remote changes. A Fetch will only update these remote tracking branches. A Pull first executes a Fetch, and then merges the changes with a locally editable branch.

On the source computer there was no need to create this branch, as it was initialized locally, and pushing the branch can create the remote branch.

You can create a local branch from the remote branches by Right clicking on the Remote branch in the Git Repositories view, and selecting Create branch... After that, your branch would be writable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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