找不到我的git存储库网址 [英] Can't find my git repository url
问题描述
所以我认为我很困惑 - 但出于某种原因,我不能将 push
或拉
到我的git存储库。
So I think I am confused - but for some reason I cannot push
or pull
to my git repository.
我有一个linux web服务器,并在 /var/www/bcs.net.nz /
I have a linux web server and have a web folder in /var/www/bcs.net.nz/
我在这个文件夹中做了一个 git init bcs.git
(我也试过 .git
)
,然后我想我可以做 git clone git@bcs.net.nz:bcs.git
来克隆它在本地机器上或远程机器上的 git push
。
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.
我还添加了一个 git remote add origin git@bcs.net.nz:bcs.git
在远程机器上。
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初始提交
工作正常。
git add .
& git commit -m "initial commit"
work fine.
推荐答案
git clone git@bcs.net.nz:bcs.git
将意味着克隆 裸回购 ) > /home/git/bcs.git
你可以初始化一个,( git init --bare / home / git / bcs.git
),然后添加一个 post-receive hook ( chmod 755 /home/git/bcs.git/hooks/post-receive
)这将检查在活动服务器文件夹中的代码
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
这篇关于找不到我的git存储库网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!