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.