Re: help with git/github

Phillip Hutchings <[email protected]> Sat, 24 Dec 2011 10:03:04 +1300
Newsgroups gmane.org.user-groups.linux.new-zealand.general
Message-ID <[email protected]>
On 23/12/2011, at 7:36 PM, Robin Paulson wrote:

> i'm working on a project on gthub, which is a fork of another project. =
recently the parent project has created a 3.0 branch (which is beta), =
and then added a lot of commits to the master branch, which now contains =
the 3.5 alpha code
>=20
> i want to continue merging (cherry-picking) commits from what is now =
the '3.0' branch, but when i go to 'network queue' in github (the place =
from which i have previously done this) in my fork, i am offered all the =
commits from both the '3.0' and 'master' (i.e. 3.5 alpha) branches. is =
there any way to limit the offered commits to only those from the '3.0' =
branch?
>=20
> i think github doesn't have the power to do this and it needs to be =
done via git, but i'm still pretty new to it and not sure where to look. =
i think it might be the 'rebase' command i need, or possibly 'merge =
remote-tracking' (thanks to morris for that suggestion), but i'm =
concerned i will fubar everything and not be able to get back - i can't =
see what it's actually doing.

You don't want to rebase, trust me.

If I understand your remote has just change the branch names, so where =
before you merged from origin/master you now want to merge from =
origin/3.0? In the command line land this would be called changing the =
remote tracking.

I've never seen an option to do this on github, but you can always =
specify any merge branch you like on the command line. Git's remote =
tracking feature (which is what GitHub is exposing here) is just a =
convenience so you don't have to type it all the time.

So get a local clone of your repo, add a remote pointing to the original =
repo, then you can just git fetch; git merge upstream/3.0; git push =
origin, or you could use gitk master upstream/3.0 to get a graphical =
representation.

This may make the network queue on github break, but it'll work fine.=20

--
Phillip Hutchings
[email protected]




_______________________________________________
NZLUG mailing list [email protected]
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug