1

I'm in a situation where I have a local source tree that was cloned from a git repository, that I'm trying to push to a new remote location.

I installed gitolite on the server using the package method (deb). I followed the Wiki instructions, ending with a successful git clone gitolite@localhost:gitolite-admin. I then added the new repository, and my public keys. I can clone this repository on my machine (the client), but am not able to push into it. The SSH troubleshooting document describes my scenario aptly:

consider git@server:repositories/reponame.git. The clone operation will work -- you're using the full Unix path, (assuming default $REPO_BASE setting), and so the shell finds the repo where you said it would be. However, when you push, gitolite's update hook kicks in, and fails to run because some of the environment variables it is expecting are not present

So, I can clone with

git clone gitolite@server.com:repositories/reponame.git

but not with

git clone gitolite@server.com:reponame.git (I get fatal: 'reponame.git' does not appear to be a git repository)

If I make changes to the cloned (empty) repository and try to push, I get

remote: ENV GL_RC not set remote: BEGIN failed--compilation aborted at hooks/update line 20. remote: error: hook declined to update refs/heads/master

So, this seems related to the prefixing - however, as I've mentioned, I can not clone the repo without including the repositories/ specifier in the path.

Is this what is meant by "bypassing gitolite"? How can I rectify the situation? Ultimately, I want to push the entire pre-existing source tree to the new remote (I've added the new server as a remote in .git/config), and maintain history.

Community
  • 1
  • 1
appas
  • 4,030
  • 2
  • 19
  • 17

2 Answers2

0

git clone gitolite@server.com:reponame.git (I get fatal: 'reponame.git' does not appear to be a git repository)

The path of reponame.git is not right. You should add the prefix repositories/

git clone gitolite@server.com:repositories/reponame.git 

means the reponame.git is locate at /home/gitolite/repositories/reponame.git.

Haifeng Li
  • 455
  • 4
  • 16
0

I would recommend installing gitolite with the client method. For me it took care of this exact issue.

Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141