GnuCash+git development process with multiple branches?

John Ralls jralls at
Sun Jun 30 17:29:12 EDT 2013

On Jun 30, 2013, at 1:38 PM, Derek Atkins <warlord at MIT.EDU> wrote:

> Hi all,
> Last week I just upgraded my main laptop from Fedora 15 to Fedora 18.
> One of the side effects of this change was that PERL got updates from
> 5.12 to 5.16, and SVK (which I've been using for years) no longer
> works.  SVK has long-since been abandoned (back in 2010) which basically
> means I'm not being forced to switch over to git-svn.  Yay me.
> One of the things that SVK allowed me to do was to have a single copy of
> the repository locally and then from there I could check out multiple
> branches into different WC directories.  Whenver I wanted to pull
> changes from the upstream server (svk sync) it would pull those changes
> once into the central repo (on all branches, of course) and then I could
> pull those updates into my WCs (svk update).
> I want to replicate this behavior using git/git-svn.  Part of my
> reasoning is that if I'm working on 5 different branches I don't feel
> like I need 5 full copies of the repo (although I doubt there is a way
> to get git to do that).  However, more importantly, when I pull updates
> from the upstream server I don't want to have to fetch those changes
> independently for each checked-out branch/WC.  My reasoning for this is
> that for some of my (non-GnuCash) work the pipe is rather thin and/or
> behind a VPN firewall so I'd like to pull everything once and then
> spread locally.
> So I guess this boils does to more of a general git question than
> specifically gnucash, but ---- how do you work with multiple branches
> simultaneously?  This is particularly important because of having to
> dcommit back upstream.
> My first attempt was to do a git clone --bare and then figuring I could
> git-clone from there for my branches.  It converts my 'svk sync' to a
> 'git fetch' in the bare repo and 'svk update' to a 'git-update' (or git
> pull) from my WCs.  Alas, this doesn' *quite* work because the git fetch
> fails with:
> Fetching origin
> fatal: Couldn't find remote ref HEAD
> error: Could not fetch origin
> This is probably because refs/heads/ is empty in the bare repo?
> So what do you all do?  I'm thinking that once I figure it out I'll
> update the GnuCash Git Wiki Page, although honestly I'm probably the
> last dev to migrate to git :-P

Whew! I was afraid you were going to say that upgrading to perl 5.16 blew up

I just keep one git repo and flip around the branches as needed.

Left to itself, git pull will update all of the checked out branches in the local repo,
but we can't let it do that because each branch needs to have its refs updated
(particularly for new tags), so git-update only rebases the currently checked out
branch, so you have to git-update each branch in turn. More important, you need
to fetch and update between dcommits when you're working in more than one
branch (like backporting a change) or git-svn gets all confused and you spend a 
bunch of time resetting it back and rebasing before it will let you dcommit again.

None of which explains why having a local bare clone wouldn't work. In fact, I just
tried it and it seems to work -- though there aren't yet any changes to update, it didn't
whine about anything:
  $ athena:/Users/john> git clone --bare git:// into bare repository 'gnucash.git'...
  remote: Counting objects: 165617, done.
  remote: Compressing objects: 100% (27553/27553), done.
  remote: Total 165617 (delta 137995), reused 165002 (delta 137411)
  Receiving objects: 100% (165617/165617), 109.62 MiB | 4.63 MiB/s, done.
  Resolving deltas: 100% (137995/137995), done.
  $ athena:/Users/john> cd gnucash.git
  $ athena:/Users/john/gnucash.git> git fetch
  From git://
   * branch            HEAD       -> FETCH_HEAD
  $ athena:/Users/john/gnucash.git>

I'll leave it and try again tomorrow after somebody commits something.

John Ralls

More information about the gnucash-devel mailing list