我在我的远程服务器上已经有了一个非git目录(/var/www/site1),我使用ftp对它进行了修改,但我想使用git。下面是我所做的:
cd ~/git/site1.git
git init --bare
cat > hooks/post-receive
#!/bin/sh
GIT_WORK_TREE=/var/www/site1 git checkout -f
$ chmod +x hooks/post-receive如何将文件添加到git存储库,以便可以将文件拉到本地目录?我试过了:
git remote add ssh://root@remote:3756/git/site1.git site1
git pull site1 +master:refs/heads/master
fatal: Couldn't find remote ref master我也试过了:
git clone ssh://root@remote:3756/git/site1.git site1
Cloning into 'site1'...
warning: You appear to have cloned an empty repository.我正在学习本教程:http://toroid.org/ams/git-website-howto
发布于 2012-06-27 10:45:11
将文件下载到您的计算机,克隆存储库,将文件复制到存储库文件夹,提交文件,然后推送到服务器。如果你打算用git来上传文件到网站,不要使用git,因为文件是不可见的。
https://stackoverflow.com/questions/11218591
复制相似问题