• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Git branch and github forks

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Shelnutt2

Overclockers Team Content Editor
Joined
Jun 17, 2005
Location
/home/
So in working on ics for my heroc, I've decided to return to cm sources instead of the evervolv sources that the other devs like. I've been working on getting it building and I've just been using git branch, where I've branched off and made my own changes. The problem I've just realized is that I don't know how I can push these back to github as a new branch. From reading on the web it seems like I should have "forked" each repo on github first. Anyone know an easy way to push my branches to github?

I was admin/write access to the main repos if that matters.
 
The only reason to fork is if you don't have access to the repository; you would fork to get your own copy which you could write to, and then send pull requests to the upstream.
To add your new branch to a remote you have access to, you only need to git push -u origin branch where origin may be any remote (git remote -v to list them) and branch may be any local branch name. Once you've done it the first time with -u to create the new branch on the remote, you can just do the standard git push from then on.
 
Last edited:
You will need to fork the repo on github/gitorious first if you just cloned it locally, unless you can add yourself a SSH key to that repo. If you cant add your SSH key you will want to push to your fork. After you push to your fork you can then send a "pull request" to the master repo.

If it helps any I use Eclipse with Aptana to work with GIT, seems to make things a lot easier for me.
 
Last edited:
Back