[TYPO3-core] [GIT] Best practice with daily tasks

Steffen Kamper info at sk-typo3.de
Tue Mar 1 23:23:59 CET 2011


Am 01.03.2011 22:09, schrieb Stefano Kowalke:
> Hey Steffen,
>> What you describe is pushing into a branch. This means the remote branch.
>> (is this allowed with gerrit?)
> You push into ":refs/for/<branchname>". This is a pseudobranch which
> only exist in gerrit. If you push into this pseudobranch, the commit
> will be pass to gerrit and if the patch is ok, gerrit knows in which
> branch this shall be merged (refs/<branchname>).

i'm still a bit afraid of doing this :) I wait until i get concrete 
instructions from the team.

> What Peter means, it that is doesn't matter on which branch you working
> local. _You_ specify in which branch it shall go on remote. So you can
> work on master and push it into a feature branch.
>> Let's say, i did some changes in my local master. Now i want to commit
>> it into a new branch. Long way would be:
>> checkout to a new branch
>> merge master into this branch
>> commit
> No. This makes no sense, because master and branch are the same, if you
> branch from master.
> Let say you want fix a bug with number 123 and you have only master as
> local branch:
> $ git branch
> * master
> Then create a new branch from master:
> $ git checkout -b bugfix_123 master
> Now you are on the bugfix branch:
> $ git branch
> master
> * bugfix_123
> Fixing the bug .... takes some while ....
> (While you fixing the bug you can commit your changes right into the
> bugfix branch)
> When you thing your are finished.
> Push this branch to gerrit (this works only if you setup a remote for
> "for-master"):
> $ git push for-master
> Now you and the reviewer can vote for the patch.
> *Skip section about review process*

this is in general what i had in mind. Maybe my wording isn't clear atm 
as i'm still in svn world mentaly.

> If the patch is ok, gerrit merge it with the tree. And you can delete
> your local bugfix branch and do a
> $ git rebase
> or
> $ git pull
> (I am not sure about this)

as i learned today it's the most easy to checkout master again, pull for 
getting last changes and deleting the not needed branch (if it's 
reviewed and merged/rejected.

> Now your local repo is synced with the remote repo.

i start to get warm with GIT - the branching really is a killer feature!

Thanks all for the help, it helps making much things clearer.

vg Steffen

More information about the TYPO3-team-core mailing list