[TYPO3-v4] Question about Git branches

Oliver Hader oliver.hader at typo3.org
Wed Mar 2 15:39:44 CET 2011


Hi Ernesto,

Am 02.03.11 09:41, schrieb Ernesto Baschny [cron IT]:
> François Suter schrieb am 01.03.2011 18:41:
> 
>> Not being in Berlin I missed contact with the Git gurus, so here's a
>> couple of questions about branches in Git.
>>
>> I have cloned the TYPO3v4 project and now have a local repository,
>> stored on my hard drive in /usr/local/src/typo3/Core/
>>
>> Now in my ~/Sites/typ45 folder - for example - I have a local TYPO3
>> install which was symlinked to the TYPO3 source in this way (when using
>> Subversion)
>>
>> typo3_src -> /usr/local/src/typo3/TYPO3_4-5/
>>
>> I have thus 2 questions:
>>
>> 1) if I want to work on a patch for TYPO3 4.5 I should create a branch
>> based on origin/TYPO3_4-5 and not origin/master. Right?
>>
>> 2) I understand that Git branches are not "physical" like SVN branches.
>> What do I need to do to fix/replace my symlink setup?
> 
> A git clone contains *all* branches of TYPO3. So to have different
> directories pointing to different releases, you could have multiple
> clones and simply "checkout" the right branch to work on in different
> locations:
> 
> # Clone the remote source once:
> 
> $ git clone git://git.typo3.org/TYPO3v4/Core.git TYPO3v4-trunk
> 
> # Configure this clone with the commit hook, pushUrl etc..
> 
> # Clone the clone":
> 
> $ cp -a TYPO3v4-trunk TYPO3v4-5
> 
> # Checkout another branch on this second clone:
> 
> $ cd TYPO3v4-5
> TYPO3v4-5$ git checkout -b TYPO3_4-5 remotes/origin/TYPO3_4-5
> TYPO3v4-5$ git branch -v
> * TYPO3_4-5 78cee89 Fixed bug #17776: Backend layout wizard uses invalid
> stylesheet path (Thanks to Markus Klein)
>   master    ab03d19 [BUGFIX] fix t3lib_extMgm::addToAllTCAtypes(..... ,
> 'replace:xxx')
> 
> 
> Now you have separate dirs with TYPO3v4-trunk and TYPO3v4-5 and can
> symlink to them and make "git pull" on them and it will pull and merge
> for the respective branch.
> 
> That's how I would do right now, but I obviously am not a GIT expert yet.

That helped a lot. Thanks for sharing this information.

Cheers,
Olly
-- 
Oliver Hader
TYPO3 v4 Core Team Leader

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org


More information about the TYPO3-project-v4 mailing list