* Integration-Manager Workflow
@ 2010-01-16 17:49 Adrián Ribao Martínez
2010-01-16 19:06 ` Michael Poole
0 siblings, 1 reply; 4+ messages in thread
From: Adrián Ribao Martínez @ 2010-01-16 17:49 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: Text/Plain, Size: 1907 bytes --]
Hello everybody, I'm learning git since I'm planning moving from Bazaar.
I've been reading the documentation and the progit book, which is excellent.
I'm a bit confused In the chapter: http://progit.org/book/ch5-1.html#integrationmanager_workflow : "Integration-Manager Workflow"
I need to manages a project with several developers. Those developers are split into teams.
I'm planning these:
* A central repository using the http protocol. This central repository would be only writable by myself, it would have http access for the developers and ssh access for me.
* Every team would have ssh access to their repositories. i.e. team1.myserver.net, team2.myserver.net
* I want at least three branches: master, test, and develop. The path would be: develop(development version) -> test (beta) -> master (stable)
* I don't want any developer to write into the develop branch, and if they do by mistake, I don't want to take it into account.
My question is about the branches in the teams repositories. I want the developers to create feature/fix branches in their checkouts and when they have finished the work, I check and merge into develop if everything is OK.
Is the following procedure correct?:
1. They send me the path of the branch I should do: git checkout --track origin/feature1 (where origin could be: ssh://user@team1.myserver.net:/home/user/git/project)
2. If everything is ok I merge into development and remove branch feature1.
3. They fetch and the branch is deleted in their local checkouts, and the feature1 is in the develop branch: git pull origin
What happens if they accidentally work in the develop branch instead of creating a new one? What should we do?
I think I should never fetch from teamx.myserver.net to avoid this problem and instead track the branch like in step 2. Is this correct?
Thank you for your help, I'm a bit confused about git.
Regards,
Adrian Ribao
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Integration-Manager Workflow
2010-01-16 17:49 Integration-Manager Workflow Adrián Ribao Martínez
@ 2010-01-16 19:06 ` Michael Poole
2010-01-16 19:47 ` Adrián Ribao Martínez
0 siblings, 1 reply; 4+ messages in thread
From: Michael Poole @ 2010-01-16 19:06 UTC (permalink / raw)
To: Adrián Ribao Martínez; +Cc: git
Adrián Ribao Martínez writes:
> What happens if they accidentally work in the develop branch instead of creating a new one? What should we do?
> I think I should never fetch from teamx.myserver.net to avoid this problem and instead track the branch like in step 2. Is this correct?
It is simpler than that.
If you just use "git remote add teamx teamx.myserver.net:/...." (rather
than cloning your integration repository from one of those
repositories), it will leave all your local branches alone -- any
changes to teamx.myserver.net's "develop" branch will only show up in
the teamx/develop tracking branch.
The reason is that a fetch or pull only merges into your develop branch
if your branch.develop.merge git-config entry specifies an upstream
branch -- more detail can be found in the git-config man page under
branch.<name>.remote and branch.<name>.merge.
Those entries are set up when you clone from a repository, and through
some other commands, but if teamx clones from the integration server,
they can only mess up their own develop branch. If/when you push into
teamx's repository from yours, you can forcibly overwrite any of those
accidental changes. (Normally, though, the push would only do a
fast-forward merge -- so if teamx made such a mistake, the merge will
fail until you address the mismatch.)
Michael Poole
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Integration-Manager Workflow
2010-01-16 19:06 ` Michael Poole
@ 2010-01-16 19:47 ` Adrián Ribao Martínez
2010-01-17 2:53 ` Michael Poole
0 siblings, 1 reply; 4+ messages in thread
From: Adrián Ribao Martínez @ 2010-01-16 19:47 UTC (permalink / raw)
To: Michael Poole; +Cc: git
[-- Attachment #1: Type: Text/Plain, Size: 1965 bytes --]
> Adrián Ribao Martínez writes:
>
> > What happens if they accidentally work in the develop branch instead of creating a new one? What should we do?
> > I think I should never fetch from teamx.myserver.net to avoid this problem and instead track the branch like in step 2. Is this correct?
>
> It is simpler than that.
>
> If you just use "git remote add teamx teamx.myserver.net:/...." (rather
> than cloning your integration repository from one of those
> repositories), it will leave all your local branches alone -- any
> changes to teamx.myserver.net's "develop" branch will only show up in
> the teamx/develop tracking branch.
I think this is a stupid question but, how do I bring the feature1 branch from teamx to my local repository?
>
> The reason is that a fetch or pull only merges into your develop branch
> if your branch.develop.merge git-config entry specifies an upstream
> branch -- more detail can be found in the git-config man page under
> branch.<name>.remote and branch.<name>.merge.
>
> Those entries are set up when you clone from a repository, and through
> some other commands, but if teamx clones from the integration server,
> they can only mess up their own develop branch. If/when you push into
> teamx's repository from yours, you can forcibly overwrite any of those
> accidental changes. (Normally, though, the push would only do a
> fast-forward merge -- so if teamx made such a mistake, the merge will
> fail until you address the mismatch.)
I'm not sure if I understand.
1. I bring the feature1 to my local repository.
2. Check if everything is ok
3. Merge or rebase the branch into develop
4. Push the develop changes into the in central repository
5. Push and force the develop changes into the teamx server
6. The developers pull their local repositories from teamx server
Is this correct? What are the commands for all those actions?
>
> Michael Poole
>
Thank you.
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Integration-Manager Workflow
2010-01-16 19:47 ` Adrián Ribao Martínez
@ 2010-01-17 2:53 ` Michael Poole
0 siblings, 0 replies; 4+ messages in thread
From: Michael Poole @ 2010-01-17 2:53 UTC (permalink / raw)
To: Adrián Ribao Martínez; +Cc: git
Adrián Ribao Martínez writes:
>> Adrián Ribao Martínez writes:
>>
>> > What happens if they accidentally work in the develop branch instead of creating a new one? What should we do?
>> > I think I should never fetch from teamx.myserver.net to avoid this problem and instead track the branch like in step 2. Is this correct?
>>
>> It is simpler than that.
>>
>> If you just use "git remote add teamx teamx.myserver.net:/...." (rather
>> than cloning your integration repository from one of those
>> repositories), it will leave all your local branches alone -- any
>> changes to teamx.myserver.net's "develop" branch will only show up in
>> the teamx/develop tracking branch.
>
> I think this is a stupid question but, how do I bring the feature1 branch from teamx to my local repository?
In brief, "git fetch teamx" -- it will copy that repository's branches
into "tracking" branches. In your repository, they will be named like
teamx/develop, teamx/test, teamx/feature, and so on.
When you run the "git remote add teamx ${location}" command, it creates
a section in .git/config that looks like this:
[remote "teamx"]
url = ssh://teamx.myserver.net/home/teamx/product.git
fetch = +refs/heads/*:refs/remotes/teamx/*
This tells git to copy the remote branches to tracking branches; it will
not overwrite any of your own branches. You can later add "push"
entries to this section to change the default behavior for "git push
teamx". For example, adding:
push = refs/head/develop
push = refs/head/test:refs/head/test
push = +refs/head/master
These all tell git to push your local branch (develop, test or master)
to the same branch name in the teamx repository. The + in the last line
says to push even when it is not a fast-forward. (The "<refspec>"
section of the git-push man pages has more discussion of the syntax.
Using these push entries makes sure that you don't accidentally modify a
feature branch on the team's repository.)
>>
>> The reason is that a fetch or pull only merges into your develop branch
>> if your branch.develop.merge git-config entry specifies an upstream
>> branch -- more detail can be found in the git-config man page under
>> branch.<name>.remote and branch.<name>.merge.
>>
>> Those entries are set up when you clone from a repository, and through
>> some other commands, but if teamx clones from the integration server,
>> they can only mess up their own develop branch. If/when you push into
>> teamx's repository from yours, you can forcibly overwrite any of those
>> accidental changes. (Normally, though, the push would only do a
>> fast-forward merge -- so if teamx made such a mistake, the merge will
>> fail until you address the mismatch.)
>
> I'm not sure if I understand.
The process you listed looks workable, although I would swap 2 and 3 to
save commands when the change is good (with no extra commands if the
change is bad). In addition, merging first will find merge conflicts
before you do any verification.
> 1. I bring the feature1 to my local repository.
git fetch teamx
> 2. Check if everything is ok
git checkout teamx/feature1
make clean test (or whatever is appropriate)
> 3. Merge or rebase the branch into develop
git checkout develop
git merge teamx/feature1
If I were to swap the two steps above, I would make sure I was on the
develop branch, and then run:
git merge teamx/feature1
make clean test
If the check-out fails, "git reset --hard HEAD^" will back up to the
first parent commit -- in this case, the previous tip commit for
"develop". If the check passes, the rest of the process is the same.
> 4. Push the develop changes into the in central repository
git push central develop
> 5. Push and force the develop changes into the teamx server
git push teamx develop
> 6. The developers pull their local repositories from teamx server
git pull teamx
Hopefully this helps explain things.
Michael Poole
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-17 2:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-16 17:49 Integration-Manager Workflow Adrián Ribao Martínez
2010-01-16 19:06 ` Michael Poole
2010-01-16 19:47 ` Adrián Ribao Martínez
2010-01-17 2:53 ` Michael Poole
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).