Hi
Dne Mon, 10 May 2010 06:00:39 -0400
Marc Delisle <marc(a)infomarc.info> napsal(a):
Piotr Przybylski a écrit :
> Hi,
>
> I want to determine the proper way to work with Git before I break my
> local repository or overly complicate something simple. As I
> understand, the development of projects is to take place in our own
> repositories, preferably push mode repositories made here -
>
http://repo.or.cz/regproj.cgi?fork=phpmyadmin.git .
>
> Currently I have a copy of
> ssh://crackpl@phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
> and if possible, I would like to configure it so that I will not have
> to pull ~150 MB over my ADSL again. After looking at the Wiki, I came
> up with these commands:
The commits are same for all repositories, so they are shared. However
if you prefer to have another working copy for this repository, you can
use --reference parameter to git clone to reuse existing copy of the
main repository.
1. git remote
add my-repo git://repo.or.cz/phpmyadmin/my-gsoc-fork.git
Piotr,
the wiki said to use your nick name as a repository name on repo.or.cz.
Look at the existing forks:
http://repo.or.cz/w/phpmyadmin.git/forks
But you are a special case because you already are a team member. I
wonder if we should treat you as a team member or as a student...
In this case I'd prefer to have same way for all students.
> 2. git remote update my-repo
> 3. git checkout my-repo/master
You should create local branch where you will work:
git brach --tracking gsoc my-repo/master
Then:
git checkout gsoc
(where gsoc can be replaced by any name you prefer for local branch)
3. working on
my code
4. commit
5. push (pushes to my repository)
Now, to merge main branch with my code I need to update it:
6. git checkout origin/master
I think this should be
git checkout master
Right.
7. git pull
Switch to mine branch and merge:
8. git checkout my-repo/master
9. git merge origin/master
Did I get it right?
I think that "git rebase origin/master" would keep the history of your
own branch.
Yes, this way you can get rid of the merge commits. On the other say it
is not a good thing to do on already published changesets, because by
this you effectively change your history and it is harder for anybody
else to base on your repository.
--
Michal Čihař |
http://cihar.com |
http://blog.cihar.com