开发者

Git: gitolite have mess things up? working on two different servers

开发者 https://www.devze.com 2023-02-14 20:29 出处:网络
I am new in using Git, so here is my context: I am in a situation in which I work on two projects which are stored in different repositories on different servers. On both servers is used gitolite to h

I am new in using Git, so here is my context: I am in a situation in which I work on two projects which are stored in different repositories on different servers. On both servers is used gitolite to handle the administration on the repositorie开发者_如何学编程s.

When I had one project to handle I push the commits to the server with the command: git push --all git@myserver1.com:project1 and it was OK. Now, when I handle two projects, I thought that it should be OK, if I am using the same command, only changing the server name and project, to deploy it on the server.

However is not OK, now when I write git push --all git@myserver2.com:project2 (I am running this command from root folder of the project) is asking me for the password: git@myserver2.com's password: and after I type a password I get: Permission denied (publickey,password). But this behavior is not right because I already have set my public key on this second server.

I don't know where is the problem, maybe gitolite have mess things up? Combining on my PC the configuration for the two servers?


when I write git push --all git@myserver2.com:project2 (I am running this command from root folder of the project) is asking me for the password.

That means your public key hasn't been pushed to the gitolite repo of myserver2.
You need to add it to your local gitolite-admin repo, in the keydir directory, and push that repo to myserver2, in order for gitolite to add it to the .ssh/authorizedkeys file.

For myserver1 or myserver2, you need to be able to type:

ssh git@myserver2.com

and have your gitolite ACL displayed.
If you don't see those rights (if you need to enter your password), then something is still wrong.

0

精彩评论

暂无评论...
验证码 换一张
取 消