【发布时间】:2012-07-23 19:27:29
【问题描述】:
我正在尝试实现一个简单的场景,我在一台服务器上有一个 git 存储库,并且我能够将此存储库推送到远程服务器。在解决了许多其他问题后,我陷入了以下阶段:
在 server1 上,我有一个 git repo。现在我按照http://thelucid.com/2008/12/02/git-setting-up-a-remote-repository-and-doing-an-initial-push/ 中列出的步骤进行操作
即 1) ssh 到远程服务器 2)创建目录 3) 裸初始化一个 repo 4)退出并在本地服务器上使用以下语句添加远程
git remote add api User@example.com:/Myproj.git
5) 推送到远程。 (git push -u api master)
我得到的错误是
git: '/Myproj.git' is not a git command. See 'git --help'.
fatal: The remote end hung up unexpectedly
如何解决这个问题?我正在使用 MsysGit 1.7.10,并且两台服务器上的 ssh 服务器都是 Cygwin。
=========================
添加 GIT_TRACE=2 git push -u api master 的输出
$ GIT_TRACE=2 git push -u api master
trace: built-in: git 'push' '-u' 'api' 'master'
trace: run_command: 'ssh' 'Administrator@api.example.com' 'git-receive-pack '\''
/Myproj.git'\'''
git: '/Myproj.git' is not a git command. See 'git --help'.
fatal: The remote end hung up unexpectedly
=======================
GIT_TRACE=2 git push -u api master 的输出(在进行全局 git 配置更改后)
$ GIT_TRACE=2 git push -u api master 跟踪:内置:git'push''-u''api''master' 跟踪:run_command:'ssh''Administrator@api.example.com''git 接收包'\'' /MyProj.git'\''' 致命:“/MyProj.git”似乎不是 git 存储库 致命:远端意外挂断
【问题讨论】: