2012-07-23 173 views
0

我想实现一个简单的场景,我在一台服务器上有一个git repo,并且能够将此repo推送到远程服务器。解决了很多其他问题之后,我停留在以下阶段:无法推送到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)裸初始化回购 4)出口和本地服务器上远程使用下面的语句

添加
git remote add api [email protected]:/Myproj.git 

5)推送到远程。 (混帐推-u API主)

我得到的错误是

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推-u API主的输出

$ GIT_TRACE=2 git push -u api master 
trace: built-in: git 'push' '-u' 'api' 'master' 
trace: run_command: 'ssh' '[email protected]' '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推-u API主输出(后做全球GIT中配置变化)======================

$ GIT_TRACE = 2 git push -u api master trace:内置:git'push''-u''api''m aster' trace:run_command:'ssh''[email protected]''git receive-pack'\'' /MyProj.git'\'''' 致命:'/MyProj.git'未出现是一个Git仓库 致命:远程端挂机意外

回答

2

我认为,所有你需要的是删除一个斜线和运行:

git remote add api [email protected]:Myproj.git 
+0

不,这是行不通的。我已经尝试过了。 – shashi 2012-07-23 19:37:23

+0

什么是错误? – xaizek 2012-07-23 19:38:38

+0

在这种情况下,我得到“Myproj.git”不是git命令。 – shashi 2012-07-23 19:38:59

相关问题