Discussion:
help with git/github
Robin Paulson
2011-12-23 06:36:46 UTC
Permalink
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

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?

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.

any suggestions?

cheers,
--
robin

http://fu.ac.nz - Auckland's Free University

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Phillip Hutchings
2011-12-23 21:03:04 UTC
Permalink
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
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?
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.

--
Phillip Hutchings
***@sitharus.com




_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Robin Paulson
2011-12-25 23:20:16 UTC
Permalink
Post by Phillip Hutchings
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.
that's the one, cheers. it took a bit of working out, but i got there
in the end. yes, rebase is completely different, it wouldn't have helped
i realise now. i'll have to do some more research into gitk, i'm not
quite sure what the graphical representation there means
Post by Phillip Hutchings
This may make the network queue on github break, but it'll work fine.
no, that's ok. i can examine the commits using git on the command line

thanks for the assistance
--
robin

http://fu.ac.nz - Auckland's Free University

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Loading...