【发布时间】:2012-06-27 02:28:42
【问题描述】:
我的远程服务器上有一个已经在工作的非 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.
【问题讨论】:
标签: git deployment ssh