[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problems cloning a git repository



Thanks for the reply.
Clint Adams wrote:
On Sat, Jul 11, 2009 at 07:28:11PM +0200, Loïc Martin wrote:
git clone git+ssh://<username>@git.debian.org/git/pkg-games/<package>.git
works, but it only pulls master (there should also be prisine-tar and upstream), and without pulling previous commits in the log for master.

Try git branch -lr
You should see all your remote branches if they are indeed in the repo.

I've got master, pristine-tar and upstream showing up. I still can't get the git pull command to work though, I've tried about any possible combination I could think of when referring to git-pull man page.

git-pull origin +refs/remotes/master:refs/remotes/master
git pull origin +refs/remotes/alioth/*:refs/remotes/alioth/*
git pull origin +refs/remotes/alioth/master:refs/remotes/alioth/master
git pull origin +refs/remotes/origin/master:refs/remotes/origin/master
git pull alioth +refs/remotes/*:refs/remotes/*
git pull git+ssh://loicm-guest@git.debian.org/git/pkg-games/gmameui.git +refs/remotes/*:refs/remotes/* git pull git+ssh://loicm-guest@git.debian.org/git/pkg-games/gmameui.git +refs/remotes/master:refs/remotes/master git pull git+ssh://loicm-guest@git.debian.org/git/pkg-games/gmameui.git +refs/remotes/alioth:refs/remotes/alioth

When there's a * somewhere like the wiki advises, I always get the same error:
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me either.  Please
name which branch you want to merge on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details on the refspec.

When I use a branch name, I always get something along the lines:
> fatal: Couldn't find remote ref refs/remotes/alioth/master

.git/branches was always empty on my original package directory, the files alioth/{master|pristine-tar|upstream} were in .git/refs/remotes and in .git/logs/refs/remotes, the files {master|pristine-tar|upstream} were in .git/refs/heads .git/logs/refs/heads and .git/refs/head


I tried some more stuff looking at .git/config, but it still doesn't work:
And if I do:
git pull origin +refs/heads/*:refs/remotes/origin/*

I get the following error:
Already up-to-date with 20e5f927d332fe17797c7b70fe0722155acf2363
Unable to find common commit with aff8c6262f4f1f92b202d6bc686f48a2075b4a0c
Automatic merge failed; fix conflicts and then commit the result.

If instead I use:
git pull origin +refs/heads/*:refs/remotes/alioth/*

It fetches the 3 branches (master/pristine-tar/upstream), but places them in different folders than the original git directory I had, and also ends up with the same error message just above (the "Already up-to-date..."). And the logs still don't contain previous entries that were committed to Alioth.

When I compare the .git/config between the original directory and the one from the git clone command, the new one use [remote "origin"] instead of [remote "alioth"], and has a third entry [branch "master"] that the original didn't have.

The second step plain doesn't work
git-pull origin +refs/remotes/*:refs/remotes/*
First, it seem it should be git pull and not git-pull, but I can't verify that, only that there's a pull option for git while I can't find the git-pull command in any package.

Yes, git-hyphen-command was deprecated.

I don't have any branches however (.git/branches has always been empty for my package) so I don't know how to solve that.

That's not important.  You always have at least one branch (such as master).

git-import-orig [--pristine-tar] [-u version] /path/to/upstream-version.tar.gz
Does this also commit the changes to Altioth, or do I have to do a git commit -a afterwards? The wiki seem to imply it's not necessary, and I don't remember having any trouble previously, but when I try to import a new upstream tarball in my badly cloned git repository, it doesn't and I'd probably have to use git commit -a (except the wiki doesn't say so, and I'd rather make sure before messing up the repository on Alioth).

That script will commit the upstream changes to your local repository.
It will not send your branches to Alioth unless you then do a git push.

Thanks a lot for all that info.
Loïc


Reply to: