1

I install gitolite in home directory of git user in /home/git. Now I would like to move it to /git. I copy /home/git to /git and change the home directory in /etc/passwd to be /git. I also tried it by making a link from /home/git to /git.

After the changes, when I tried to git clone git@gitserver:test1 I got the error:

fatal: 'test1' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

I think I can be in the same situation, if my disk is crushed and I need to recover everything from backup.

How I can make the /git work as /home/git work? What I'm missing?

Thanks.

user1980099
  • 573
  • 1
  • 8
  • 30

2 Answers2

1

Thanks to everyone trying to help me.

The problem solved.

The gitserver worked on CentOS release 6.4 and it a special problem.

The solution: (run on the gitserver)

    su - 
    cd ~git
    chcon -t ssh_home_t .ssh/
    chcon -t ssh_home_t .ssh/authorized_keys

Thanks again to everyone.

user1980099
  • 573
  • 1
  • 8
  • 30
0

I would rather re-install gitolite properly, and then move the "repositories" folder from its old place to its new one.
Or declare its path in the .gitolite.rc file.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I start everything from the begining. and I still get the password prompt. – user1980099 Oct 14 '13 at 14:07
  • @user1980099 password prompt? You didn't mention that in yur original question. What is the version number of your gitolite? And your git? – VonC Oct 14 '13 at 14:09
  • gitolite3 v3.5.2-16-g91aa931 on git 1.8.4 – user1980099 Oct 15 '13 at 05:38
  • @user1980099 can you clone the gitolite-admin repo with the public key you used to setup gitolite (http://gitolite.com/gitolite/setup.html `gitolite setup -pk alice.pub`) – VonC Oct 15 '13 at 05:41
  • The problem seem to be a ssh problem and not gitolite. – user1980099 Oct 15 '13 at 08:38
  • The question is why when I copy the home directory to another place it stop working? I copy all the files with all the permission etc. Is ssh have any whare information saved about the original place the user added in the first time that made it not working when changing the home directory to another place? – user1980099 Oct 15 '13 at 08:39
  • @user1980099 gitolite is called from `~/.ssh/authorized_keys`: if you move gitolite, you must update the `~/.ssh/authorized_keys` file content in order to call `gitolite-shell` with the right path. – VonC Oct 15 '13 at 08:44
  • Yes I change the gitolite-shell - with no help. I think it's more general ssh problem. maybe ssh have problem with information changed it /etc/passwd after the user added. I did my changes in passwd file with command 'vipw'. Is there any command I need to run to refresh my changes. it's the same data I have in both directroies - if I in the original home directory I use when I add the user it work. but if the password point to the new home directory it stop working. – user1980099 Oct 15 '13 at 08:58
  • I also tried to remove all the gitolite from the authorized_keys and run from my local workstation: ssh-copy-id git@gitserver. It create the file authorized_keys with the right permission but the problem still exist - it's ask password when I trying to ssh to the gitserver. – user1980099 Oct 15 '13 at 09:13
  • @user1980099 so you need to debug that first: see http://stackoverflow.com/questions/922210/unable-to-git-push-master-to-github/922461#922461 – VonC Oct 15 '13 at 09:14