<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Sounds like you should volunteer to do a talk at PHPWM on Git - I'd be interested!<div><br></div><div>Alex</div><div><br><div><div><div>On 28 Aug 2009, at 11:37, Dave Brotherstone wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5"><font class="Apple-style-span" color="#888888"><br></font>&gt;&gt; Ian Munday wrote:<br> &gt;&gt; Why Git? &nbsp;I'm familiar with CVS and Subversion, but doesn't Git<br> &gt;&gt; essentially provide the same functionality, albeit in a slightly<br> &gt;&gt; different way (local versus centralised repositories)?<br> &gt;&gt;</div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5">&gt; David Goodwin wrote<br>&nbsp;&gt;<br> &gt; My understanding (I've never really used git) was that it handles<br> &gt; branching and merging a lot better than subversion.<br> &gt;<br> &gt; I believe git can have a single centralised repository.<br> &gt;<br><br></div></div></blockquote><div><br></div><div>Well, it can... but only because you deem one repository "special" / centralised.</div><div>Branching and merging is far easier, faster and more reliable in git. So good, in fact, that I (and many others) branch for any and every feature or bug fix.&nbsp;</div> <div>You may find that for your project it suits you better. &nbsp;</div><div><br></div><div>So you could have a central branch, and one for each client. When you do something central, you can easily merge it into the client branches - you could actually script this too, so one command would merge it into all your client branches. &nbsp;</div> <div><br></div><div>For clients that have more customisation, if you end up doing something for client X that you later decide you want available to everyone, you can "cherry pick" the commit into the central branch.&nbsp;</div> <div><br></div><div>I work with SVN all day, and have done for years, but since working with git, I hate the way svn works. &nbsp;Everything in git is almost instantaneous, you won't be waiting for any merges or "switches" (called a checkout in git). &nbsp;It's also pretty clever at merging things that have diverged.&nbsp;</div> <div><br></div><div>I think doing the same thing in SVN would be perfectly possible, but you're far more likely to get into difficulty, and end up with things not merged. &nbsp;There's also some really neat features that git can do, that SVN just plain can't - stashing and rewriting history spring to mind.</div> <div><br></div><div>A good reference is <a href="http://progit.org">http://progit.org</a>, which is a really good read. &nbsp;I'll stick an example on the end of this so you can see how it might work.</div></div><div><br></div> <div>Hope that helps,</div><div><br></div><div>Dave.</div><div><br></div>An example....<div><br></div><div>&gt; git branch</div><div>* central</div><div>&nbsp;&nbsp;client1</div><div>&nbsp;&nbsp;client2</div><div>&nbsp;&nbsp;client3</div><div><br></div> <div>(So we're currently on the central branch)</div><div><br><div>&gt; git checkout client1</div><div>Switched to branch client1</div><div><br></div><div>&gt; git branch</div><div><div>&nbsp;&nbsp;central</div><div>* client1</div> <div>&nbsp;&nbsp;client2</div><div>&nbsp;&nbsp;client3</div><div><br></div><div>(Now on the client1 branch, we'll edit the langs file)</div><div><br></div></div><div>&gt; edit lang/en_GB.php</div><div>&gt; git commit -a -m "Updated language file"</div> <div><div>[central c8324b]&nbsp;Updated language file</div><div>&nbsp;1 files changed, 3 insertions(+), 2 deletions(-)</div><div><br></div><div><br></div><div>( Now we'll edit something on the central branch)&nbsp;</div><div><br></div> </div><div>&gt; git checkout central</div><div>&gt; edit src/someCentralFile.php</div><div>&gt; git commit -a -m "Fixed a bug with xxx"</div><div><div>[central b91e7b2] Fixed&nbsp;a bug with xxx</div><div>&nbsp;1 files changed, 5 insertions(+), 4 deletions(-)</div> <div><br></div><div>( and go back to client1)</div></div><div>&gt; git checkout client1</div><div><br></div><div>(now we'll check what's not been merged already)</div><div>&gt; git branch --no-merged</div><div>&nbsp;&nbsp;central</div> <div>&nbsp;&nbsp;client2</div><div>&nbsp;&nbsp;client3</div><div><br></div><div>&gt; git merge central</div><div>Automatic merge successful</div><div><br></div><div>&gt; git branch --no-merged</div><div>&nbsp;&nbsp; client2</div><div>&nbsp;&nbsp; client3</div><div> <br></div><div>(Now we'll create a new feature for client1)</div><div><br></div><div>&gt; edit src/someExtraFeature.php</div><div>&gt; git commit -a -m "Added a new feature for client1"</div><div><div>[central 944cb1]&nbsp;Added a new feature for client1</div> <div>&nbsp;1 files changed, 15 insertions(+), 1 deletions(-)</div><div><br></div></div><div>(Now we want that feature in the central branch)</div><div>&gt; git checkout central</div><div>&gt; git cherry-pick 944cb1</div><div>Automatic merge successful</div> <div><br></div><div><br></div></div> _______________________________________________<br>Phpwm mailing list<br><a href="mailto:Phpwm@mailman.lug.org.uk">Phpwm@mailman.lug.org.uk</a><br>https://mailman.lug.org.uk/mailman/listinfo/phpwm<br></blockquote></div><br></div></div></body></html>