2

I am newbie in ubuntu and I don't have much experience in ubuntu. Now, I try to setup git server on ubuntu 16.04 LTS by learing this guide https://www.linux.com/learn/how-run-your-own-git-server.

I want to create git repository on ubuntu and I want to access that git repository from windows 7 as remote. In my windows, I already installed msysgit.

But every times I try to add remote, I got fatal errors like this

fatal: '/Project/code_server' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I try a lot of way to solve this error more than one days but I can't solve it. I have no idea what I was wrong. So, please guide me. Here is what I've tried.

I want to setup git repository on my ubuntu personal account. So I skip adding a user git step from the above guide.

On my ubuntu personal account, I create git bare repository in the path /opt/lampp/htdocs/Project/code_server by using git init --bare.

(All of the following commands are made by using git bash from windows.)

After that, on my windows laptop, I create ssh key by using git bash like this: ssh-keygen -t rsa without using passphrase. And copy that keys to my ubuntu laptop like this:

$ cat /c/users/my/.ssh/id_rsa.pub | ssh devloper@192.168.2.3 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

After that, it shows like this

The authenticity of host '192.168.2.3 (192.168.2.3)' can't be established.
ECDSA key fingerprint is SHA256:CXpg2OJd3KCORAXHu/1zV194iEDElwtRlb8oX6i7X2Q.
Are you sure you want to continue connecting (yes/no)?

so, I said yes and it shows this warning again: Warning: Permanently added '192.168.2.3' (ECDSA) to the list of known hosts. and it ask to write password of ubuntu account and I type the password.

And I change the path to /c/xampp/htdocs/Project/Project-0.3 and make git init and add all code files to version controls and commit.

And then, I try to add remote as shown in below:

my@Pavilion-PC MINGW64 /c/xampp/htdocs/Project/Project-0.3 (master)
$ git remote add origin ssh://devloper@192.168.2.3/Project/code_server

And when I try to push, I got following error.

my@Pavilion-PC MINGW64 /c/xampp/htdocs/Project/Project-0.3 (master)
$ git push origin master
developer@192.168.2.3's password:
fatal: '/Attendance/code_server' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I already set RSAAuthentication yes and PubkeyAuthentication yes and also remove comment # from AuthorizedKeysFile %h/.ssh/authorized_keys.

But the problem still exists and I can't still work with remote git repository of ubuntu from winodws. I'm very appreciate for any helps.

  • Where is the home directory of devloper user on the server? – Jakuje Oct 14 '16 at 10:35
  • /home/devloper/ – Cloud Oct 14 '16 at 10:37
  • 1
    Therefore the path is obviously wrong. How it should find /Project/code_server in /home/developer/, when it is actually in /opt/lampp/htdocs/Project/code_server. Something like git remote add origin ssh://devloper@192.168.2.3:/opt/lampp/htdocs/Project/code_server should do the job. – Jakuje Oct 14 '16 at 10:41
  • So, should I need to move .ssh key folder to /opt/lampp/htdocs/Project/code_server? – Cloud Oct 14 '16 at 10:49
  • Nope. You should add a right path when using git remote add. – Jakuje Oct 14 '16 at 10:53
1

Nope. You should add a right path when using git remote add:

git remote add origin ssh://devloper@192.168.2.3:/opt/lampp/htdocs/Project/code_se‌​rver
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.