Re: repo + private repositories in github

1,253 views
Skip to first unread message

Magnus Bäck

unread,
Jun 26, 2012, 9:33:51 AM6/26/12
to repo-d...@googlegroups.com
On Monday, June 25, 2012 at 12:03 EDT,
Benoit Chesneau <bche...@gmail.com> wrote:

> I would like to use provate repositories from github in my manifest
> but it apparently fail to use/ask for my identity> Here is my manifest
> file:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <manifest>
>
> <remote name="myproject" fetch="g...@github.com:myproject/" />
>
> <default revision="master" remote="myprojecy" />
>
> <project path="someapp" name="someappe" remote="myproject"/>
>
> </manifest>
>
>
> Putting ssh:// in the fetch is better but fail with the error
> `Permission denied (publickey)` . So is there any possibility
> to use private repos ?

Of course. Repo doesn't know (or care) whether the remotes
you add are public or private.

You can get additional log output if you add the --trace option to
the repo command (i.e. "repo --trace sync"). What happens if you
run "git clone ssh://g...@github.com:myproject/someappe"?

--
Magnus Bäck
ba...@google.com

Benoit Chesneau

unread,
Jun 26, 2012, 9:47:04 AM6/26/12
to repo-d...@googlegroups.com
> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en

I had some success using g...@github.com:myproject/ by setting .ssh/config :

Host github.com
User git
Port 22
Hostname github.com
IdentityFile ~/.ssh/id_rsa.pub
IdentitiesOnly yes

but it fails with the error :
/home/benoitc/bin/repo --trace sync
: git config --file
/home/benoitc/myproject/someapp/.repo/manifests.git/config --null
--list 1>| 2>|
: unpickle /home/benoitc/.gitconfig
: git config --file
/home/benoitc/myproject/someapp/.repo/repo/.git/config --null --list
1>| 2>|
: ssh -o ControlPath /tmp/ssh-uJTh31/master-%r@%h:%p g...@github.com -O check
: ssh -M -N -o ControlPath /tmp/ssh-uJTh31/master-%r@%h:%p g...@github.com
: export GIT_DIR=/home/benoitc/myproject/someapp/.repo/manifests.git
: git fetch origin --tags +refs/heads/*:refs/remotes/origin/*
: load refs /home/benoitc/myproject/someapp/.repo/manifests.git
: git symbolic-ref -m manifest set to refs/heads/master
refs/remotes/m/master refs/remotes/origin/master 1>| 2>|
: scan refs /home/benoitc/myproject/someapp/.repo/manifests.git

: export GIT_DIR=/home/benoitc/myproject/someapp/.repo/projects/someapp.git
: git init 1>| 2>|
: git config --file
/home/benoitc/myproject/someapp/.repo/projects/someapp.git/config
--null --list 1>| 2>|
: git config --file
/home/benoitc/myproject/someapp/.repo/projects/someapp.git/config
--unset-all core.bare 1>| 2>|
: git config --file
/home/benoitc/myproject/someapp/.repo/projects/someapp.git/config
--replace-all remote.myproject.url
g...@github.com:Spotme/g...@github.com:Spotme/someapp 1>| 2>|
: git config --file
/home/benoitc/myproject/someapp/.repo/projects/someapp.git/config
--replace-all remote.myproject.projectname someapp 1>| 2>|
: git config --file
/home/benoitc/myproject/someapp/.repo/projects/someapp.git/config
--replace-all remote.myproject.fetch
+refs/heads/*:refs/remotes/myproject/* 1>| 2>|
: git fetch myproject --tags +refs/heads/*:refs/remotes/myproject/*
ERROR: Repository invalid.
fatal: The remote end hung up unexpectedly

When I look in
/home/benoitc/myproject/someapp/.repo/projects/someapp.git/config I
see:

[core]
repositoryformatversion = 0
filemode = true
[remote "myproject"]
url = g...@github.com:myproject/g...@github.com:myproject/someapp
projectname = someapp
fetch = +refs/heads/*:refs/remotes/myproject/*


The url is wrong. Seems like the remote uri have been put twice. Any idea ?

- benoit

Magnus Bäck

unread,
Jun 26, 2012, 9:54:40 AM6/26/12
to repo-d...@googlegroups.com
On Tuesday, June 26, 2012 at 09:47 EDT,
Benoit Chesneau <bche...@gmail.com> wrote:

[...]

> When I look in
> /home/benoitc/myproject/someapp/.repo/projects/someapp.git/config I
> see:
>
> [core]
> repositoryformatversion = 0
> filemode = true
> [remote "myproject"]
> url = g...@github.com:myproject/g...@github.com:myproject/someapp
> projectname = someapp
> fetch = +refs/heads/*:refs/remotes/myproject/*
>
> The url is wrong. Seems like the remote uri have been put twice. Any
> idea ?

I don't remember to what extent Repo tries to munge the URL, but have
you tried using the canonical ssh://user@host:port/repo form instead of
the scp-like user@host:repo?

--
Magnus Bäck
ba...@google.com

Benoit Chesneau

unread,
Jun 26, 2012, 10:15:28 AM6/26/12
to repo-d...@googlegroups.com
Using the canonical ssh url ssh:// worked. Thanks!

- benoît

Benoit Chesneau

unread,
Jun 26, 2012, 10:18:10 AM6/26/12
to repo-d...@googlegroups.com
Related is there another way to pass the ssh key to repo ? Other than
setting it in ~/.ssh/config ?

- benoît

Magnus Bäck

unread,
Jun 26, 2012, 10:25:57 AM6/26/12
to repo-d...@googlegroups.com
On Tuesday, June 26, 2012 at 10:18 EDT,
Benoit Chesneau <bche...@gmail.com> wrote:

> Related is there another way to pass the ssh key to repo ? Other than
> setting it in ~/.ssh/config ?

Normally it should get picked up automatically by SSH. Perhaps you have
a system-wide setting (/etc/ssh_config etc) that disables public-key
authentication? I've never had to touch ~/.ssh/config for this reason.

Unless a plain "ssh user@host" works but the same operation in Repo
doesn't, this isn't a Repo problem but an issue with your SSH client.

--
Magnus Bäck
ba...@google.com
Reply all
Reply to author
Forward
0 new messages