Can't find my git repository url

寵の児 提交于 2019-12-08 12:00:52

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/29204293/cant-find-my-git-repository-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!