0

我有两个盒子,一个是我的本地机器,另一个是我的开发服务器。现在我正在测试这种使用 Git部署应用程序的方法

我设置了本地存储库,添加了文件然后提交。我在 Windows 7 上,我的服务器是 Windows Server 2008。

服务器映射为 W:\ Drive,我的“裸”存储库和我的目标“模拟”生产文件夹作为子文件夹。- 我可以很好地访问每个,没有连接问题。

这是我为设置所有内容所做的:

  1. 本地目录 git 远程添加原点 w:\gitCentral

  2. 本地目录 git push origin master

  3. 键入 C:,然后键入 CD testDeployment

  4. 现在我在我的测试文件夹中。

    A. 我做 git clone w:/gitCentral

Cloning into gitCentral... done.
error: refs/remotes/origin/master does
not point to a valid object! error:
Trying to write ref refs/heads/master
with nonexistant object 559e2165845
06e14ebef1121059e9461a86dd4f8 fatal:
Cannot update the ref 'HEAD'.

4

2 回答 2

1

尝试执行以下操作(从您的本地文件夹开始,考虑到它是一个 git repo 并且在当前 HEAD 中有提交):

git remote add origin w:/gitCentral
git fetch origin
git push origin master
cd C:/testDeployment
git clone w:/gitCentral
于 2011-07-05T23:08:38.773 回答
0

我认为,这种情况的发生有以下两个原因之一:

Git 想要正斜杠,而不是反斜杠。Git 不喜欢空格——使用引号。

因此,如果您的遥控器是“w:\Repositories\My App”,Git 会希望将其视为“'w:/Repositories/My App'”。

这是我的预感。

于 2011-07-05T23:11:29.083 回答