[TYPO3-v4] Question about Git branches

Ernesto Baschny [cron IT] ernst at cron-it.de
Wed Mar 2 09:41:29 CET 2011


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.

Cheers,
Ernesto



More information about the TYPO3-project-v4 mailing list