Another gnucash git question

John Ralls jralls at ceridwen.us
Sat Apr 30 11:07:55 EDT 2011


On Apr 30, 2011, at 5:36 AM, Geert Janssens wrote:

> Dear John,
> 
> Christian's recent mail reminded me I'm not using the github master repository 
> yet for my git based gnucash work. So far I have been working in a repository 
> created with git svn clone, independently from your github clone.
> 
> I'd like to switch this to the setup based on the github master, but would 
> also like to keep the myriad of branches I had created so far.
> 
> Any suggestion to what would be the most practical migration path ?
> 
> So far I tried this:
> - Backed up my direct svn based repo
> - Then I ran "git remote add origin git://github.com/Gnucash/gnucash.git
> 
> I skipped the git svn init step, because I figured my repo already has that 
> information.
> 
> - I installed git-update and fixed the library line.
> - Next I ran git-update on my repo.
> 
> This command did a lot, but eventually failed. This is the truncated output 
> from the git-update command:
> warning: no common commits
> remote: Counting objects: 158809, done.
> remote: Compressing objects: 100% (29291/29291), done.
> remote: Total 158809 (delta 129729), reused 157851 (delta 129010)
> Receiving objects: 100% (158809/158809), 85.28 MiB | 2.60 MiB/s, done.
> Resolving deltas: 100% (129729/129729), done.
> From git://github.com/Gnucash/gnucashh
> * [new branch]      1.6        -> origin/1.6
> * [new branch]      1.8        -> origin/1.8
> * [new branch]      1.8 at 7931   -> origin/1.8 at 7931
> * [new branch]      2.0        -> origin/2.0
> * [new branch]      2.0 at 14476  -> origin/2.0 at 14476
> <lots more [new branch] lines>
> From git://github.com/Gnucash/gnucash
> * [new tag]         1-9-0 at 13157 -> 1-9-0 at 13157
> * [new tag]         1.6.6 at 4612 -> 1.6.6 at 4612
> * [new tag]         1.6.7 at 4608 -> 1.6.7 at 4608
> <lots more [new tag] lines>,
> You asked to pull from the remote 'origin', but did not specify
> a branch. Because this is not the default configured remote
> for your current branch, you must specify a branch on the command line.
> pull origin: command returned error: 1
> 
> And there I'm more or less stuck. Checking with gitk, I notice git-update has 
> pulled in all the objects from the remote git setup again (I presume due to 
> differing checksums), so my repo now has a remote/trunk (svn) and a 
> remote/origin/trunk branch and similar for all other branches  and tags.
> 
> Based on the error message I have also rebased one branch from remote/trunk to 
> remote/origin/trunk since they are code wise the same and tried git-update on 
> this branch. But the error remains.
> 
> Any idea how I can fix this to continue my work ?

Geert,

The first line of git-update is the perl form of `git pull --rebase origin`, and it tacks whatever additional arguments on to it. If you're not checked out in a branch that also exists on github, then git doesn't know where to pull from. It's not good practice to pull directly from a repo into a working branch, so either `git checkout trunk` before running git-update or use `git-update trunk`. 

Don't add branches to refs/remotes anything. Hang your working branches off of your local mirror-branches (trunk and 2.4 if you have one; only trunk is made automatically) -- and in this case you need to check and make sure that your local trunk is pointed to refs/remotes/origin/trunk and not refs/remotes/trunk. Check the SHA1s for the HEAD of each, and the config to be sure.

There are some notes under the <refspec> description in http://www.kernel.org/pub/software/scm/git/docs/git-pull.html that you may find helpful.

Regards,
John Ralls



More information about the gnucash-devel mailing list