简体   繁体   中英

Can't find my git repository url

So I think I am confused - but for some reason I cannot push or pull to my git repository.

I have a linux web server and have a web folder in /var/www/bcs.net.nz/

I did a git init bcs.git in this folder (I have also tried .git ) and then I thought I could do git clone git@bcs.net.nz:bcs.git to clone it on the local machine or git push on the remote machine.

I have also added a git remote add origin git@bcs.net.nz:bcs.git on the remote machine.

After all of that I still cannot push and pull anything. I am a bit stuck.

git add . & git commit -m "initial commit" work fine.

git clone git@bcs.net.nz:bcs.git would mean to clone a (preferably bare repo ) which is in /home/git/bcs.git

You could initialize one there, ( git init --bare /home/git/bcs.git ), and add a post-receive hook ( chmod 755 /home/git/bcs.git/hooks/post-receive ) which will checkout the code in the live server folder

#!/bin/sh
git --work-tree=/var/www/bcs.net.nz --git-dir=/home/git/bcs.git checkout -f

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM