Scenario:
- On the github exists the user "guru" and his primamy repository for the project called "bigsw". This primary repo has several branches. ("rel1", "rel2", "master")
- this project has 2 forks made by user1 and user2.
Each of the abobe forks has the same branches as the primary repo, plus one different branch what contains their particular work. So, user1 forked the bigsw and created a branch called "utf8" and user2 created a branch "mongo".
now i want join to the project, and for my work I need the following branches:
- guru/bigsw:master
- user1/bigsw:utf8 (read as: USER/REPO:BRANCH)
- user2/bigsw:mongo
What should be the recommended workflow?
My idea is:
- fork the guru/bisgw on the github (so will get myname/bigsw)
git clone git://github.com/myname/bigsw
(get a local copy)want keep synced local copy of user1/bigsw:utf8 branch and similarly want a copy of branch "mongo from user2's fork. So, I don't need clone the full repo from user1 and user2 only one branch from each. Somewhat like:
git remote add user1 [email protected]:user1/bigsw.git
git fetch user1
git checkout -b utf8 user1/utf8
- and similarly for user2's mongo repo (i'm not sure with the first two commands)
git checkout -b i18n
(to create MY own branch - where I will make my changes)- edit the sources (and i hoping than after the previous command they will automatically "going" into "i18n" branch)
git push origin i18n
(to push my changes to github to myname/bigsw:i18n branch)- and sometime in the future will submit an pull request for my i18n branch /don't know how, but don't need it yet ;)/
Is the above an correct workflow? If yes, questions:
- how to clone user1's branch "utf8" and user2's "mongo" branches into my local machine - Are the commands in 3.) correct?
- how to keep in sync all (so i want in my local machine synced branches from all above) - my changes will be only in my branch "i18n".
I'm total newbie for git/github - and unfortunately need start with this complicated model(at least for me). I learned something digging into https://help.github.com/ , but not understand all "git philosophy".
I was already read:
- https://stackoverflow.com/a/5458814/869025 (this helps a lot)
- https://stackoverflow.com/a/9153737/869025 - giving some ideas, but i'm not sure
- How to combine two branches from two different repositories in a single repository?
- Forking vs. Branching in GitHub
- git Merging same directory of two different repositories
- https://help.github.com/
but still wandering in the dark... :(