[Biopython-dev] Committing to github...

Peter biopython at maubp.freeserve.co.uk
Mon Sep 28 20:09:12 UTC 2009


On Thu, Sep 24, 2009 at 12:39 PM, Peter <biopython at maubp.freeserve.co.uk> wrote:
> Hi all,
>
> My last couple of commits to github have been from a local clone
> of the *official* repository: http://github.com/biopython/biopython/
>
> This is a nice and simple work flow for small changes, and the
> history and github network graph are easy to understand:
> http://biopython.org/wiki/GitUsage#Commiting_changes_to_main_branch
>
> This seems like the easiest way to work for people used to CVS,
> and you don't need to bother with your own Biopython cloned
> repository on github (you just need a github account and
> collaborator status). I'll probably continue to do this in the short
> term.

This way of working (described above) is what I have been using
for the last week. If there are multiple developers working (or in
this case, developers using multiple machines), you can still get
interesting mini-branches and merges even like this. Have a look
at the Biopython github network diagram for today for a nice
simple example (which was accidental - but serves as a nice
illustration).

[I know for some of you the following discussion isn't needed,
but I think it is worth trying to explain -  even if just for me, to
make sure it is clear in my head what git is doing.]

In words, the main trunk was split, with a (trivial) change to the
tutorial done on one branch (me at work) and then two separate
commits on a separate branch (unit tests tweak, and GenBank
bug fix), again by me, but on my home computer. The two
branches were then merged into one.

Why did this happen? I was working on a local and very slightly
out of date copy of the repository at home, and make these
local commits. I then tried to push them to github. At that
point git gave me an error saying something else had been
commited in the meantime (in fact by me but on a different
computer) so my local repository was out of date. So I pulled
and merged the latest code from github (the tutorial change),
and then pushed this to github. Done. The merge was 100%
automatic because the files changed were independent.

Back on CVS, as these changes were on separate files, there
wouldn't have been any issue about merging.

Does it matter? No. But we can reduce the likelihood of these
baby branches and merges by getting into the habit of pulling
the latest code from github *before* making any local commits
(a sensible thing to do anyway).

[Did that make sense? One the one hand this is very simple,
but on the other hand, it is rather different to how I used to
think about the code history under CVS.]

Peter



More information about the Biopython-dev mailing list