2
I have 2 machines, client and server. I want to send git repositories from client to server, using remote push. I've run these commands in this order on the server:
mkdir /mnt && cd /mnt
mkdir test.git && cd test.git
sudo git init --bare
I've run these commands on the client:
mkdir /mnt && cd /mnt
mkdir test.git && cd test.git
sudo git init
sudo git remote add testy ssh://user@server/mnt/test.git
sudo vim testing.txt
sudo git add testing.txt
sudo git commit -m "testing"
sudo git push testy master
This produces the error on the client machine:
fatal: '/mnt/test.git' does not appear to be a git repository. fatal: The remote end hung up unexpectedly.
There are several similar questions, but none of them address my problem. I've tried their solutions verbatim without success. This isn't a duplicate, because those answers do not solve the issue. Any suggestions to fix these problems?
you are missing
:
divisor between host and path insudo git remote add testy ssh://user@server:/mnt/test.git
– Jakuje – 2015-07-21T18:13:01.213you are totally overusing
sudo
, effectively breaking all permissions (and not noticing because you override them). you shoud only usesudo
for commands that require special privileges (e.g. creating the directory/mnt/test.git
); actually, in your example every single use ofsudo
is unneccessary and therefore most likely bad. – umläute – 2015-07-21T18:29:04.040If i put a colon such that i have
sudo git remote add testy ssh://user@server:/mnt/test.git
i get the error:hostname server:: cannot be resolved
. – MeesterTeem – 2015-07-21T19:07:08.177