[Phpwm] Version control - project organisation

Dave Brotherstone davegb at pobox.com
Fri Aug 28 12:42:27 UTC 2009


> Does anyone use GitHub?  Like most people, I'm very protective of code
which I've not open-sourced, so need to be reassured about putting it with
someone else. > After all, the value of my product is wrapped up in the code
base. Yes, and it rocks. For non-open sourced stuff, they have a pay option,
which isn't too bad (about $7/month, I think, for a basic account with 5
private repositories). But, if it's just you, and you want your repository
to be private, you don't really need it, as long as you backup your
repository, that's basically just the same. If there's only a single
developer, using a private repository on github just mirrors your local. You
get the github advantages, like nice views of your commits and so on, but
that's it. You can, I believe, host a git repository behind a HTTP server,
but you lose a lot of the speed, as whole files get pushed up to the server.
Running your own git server is quite easy, if you've got access to run stuff
on a remote box. BTW, other good resources are "The git parable", which is a
nice introduction to the git way of thinking, "Git for computer scientists"
and "Git from the bottom up" in ascending detail order, although I've never
read the computer scientists one, I'm told it's really good.
Dave.

On Fri, Aug 28, 2009 at 1:27 PM, Ian Munday <ian.munday at illumen.co.uk>wrote:

> On 28 Aug 2009, at 11:37, Dave Brotherstone wrote:
>
>
>> >> Ian Munday wrote:
>> >> Why Git?  I'm familiar with CVS and Subversion, but doesn't Git
>> >> essentially provide the same functionality, albeit in a slightly
>> >> different way (local versus centralised repositories)?
>> >>
>>
> > David Goodwin wrote
>>  >
>> > My understanding (I've never really used git) was that it handles
>> > branching and merging a lot better than subversion.
>> >
>> > I believe git can have a single centralised repository.
>> >
>>
>>
> Well, it can... but only because you deem one repository "special" /
> centralised.
> 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.
> You may find that for your project it suits you better.
>
> 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.
>
> 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.
>
> I work with SVN all day, and have done for years, but since working with
> git, I hate the way svn works.  Everything in git is almost instantaneous,
> you won't be waiting for any merges or "switches" (called a checkout in
> git).  It's also pretty clever at merging things that have diverged.
>
> 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.
>  There's also some really neat features that git can do, that SVN just plain
> can't - stashing and rewriting history spring to mind.
>
> A good reference is http://progit.org, which is a really good read.  I'll
> stick an example on the end of this so you can see how it might work.
>
> Hope that helps,
>
> Dave.
>
> An example....
> > git branch
> * central
>   client1
>   client2
>   client3
>
> (So we're currently on the central branch)
>
> > git checkout client1
> Switched to branch client1
>
> > git branch
>   central
> * client1
>   client2
>   client3
>
> (Now on the client1 branch, we'll edit the langs file)
>
> > edit lang/en_GB.php
> > git commit -a -m "Updated language file"
> [central c8324b] Updated language file
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
>
> ( Now we'll edit something on the central branch)
>
> > git checkout central
> > edit src/someCentralFile.php
> > git commit -a -m "Fixed a bug with xxx"
> [central b91e7b2] Fixed a bug with xxx
>  1 files changed, 5 insertions(+), 4 deletions(-)
>
> ( and go back to client1)
> > git checkout client1
>
> (now we'll check what's not been merged already)
> > git branch --no-merged
>   central
>   client2
>   client3
>
> > git merge central
> Automatic merge successful
>
> > git branch --no-merged
>    client2
>    client3
>
> (Now we'll create a new feature for client1)
>
> > edit src/someExtraFeature.php
> > git commit -a -m "Added a new feature for client1"
> [central 944cb1] Added a new feature for client1
>  1 files changed, 15 insertions(+), 1 deletions(-)
>
> (Now we want that feature in the central branch)
> > git checkout central
> > git cherry-pick 944cb1
> Automatic merge successful
>
>
> Hi Dave
>
> Thanks - that's a useful example.  I'm especially drawn to the local
> repository functionality of Git.  Being able to work offline would be great
> for me (a consequence of where I live means I only have a mobile broadband
> connection at home).
>
> I'll also look further at the Pro Git site - that appears a very useful
> resource.
>
> Does anyone use GitHub?  Like most people, I'm very protective of code
> which I've not open-sourced, so need to be reassured about putting it with
> someone else.  After all, the value of my product is wrapped up in the code
> base.
>
> Regards,
>
> Ian
>
>
> _______________________________________________
> Phpwm mailing list
> Phpwm at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/phpwm
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.lug.org.uk/pipermail/phpwm/attachments/20090828/fe65ccc3/attachment-0001.htm 


More information about the Phpwm mailing list