2012-10-13 80 views
1

对于RedHat Openshift,它有一个克隆到您本地主机的以下指令: git clone ssh://[email protected]/~/git/jimX.git/Git和Red Hat Open Shift

我想要做的是C语言创建一个文件夹:/ XAMPP/htdocs中/ RHOS(我的本地主机上)

所以我尝试:(提供及时公开,坐在C :) git的命令克隆ssh://[email protected]/~/git/xampp/htdocs/rhos.git/

我得到一个错误: 致命的:协议错误:坏行文件ngth字符:Inva

您是否需要在本地机器上克隆到jimX格式的东西?

克隆到c:/ xampp/htdocs/rhos中的命令是什么?

感谢, 吉姆

回答

0

Git FAQ mentions

It likely means you have some extraneous characters, info message or something upon logging into ssh in command mode.

要进行测试,这样做:

ssh ssh://[email protected] echo testing commands 

You should only see testing commands returned.
If there are any other characters, you should examine your dot shell rc file to find any echo or other commands that may produce output.

这是结论以及本blog post

Ahh! This was the information I needed to solve the problem.
In my case the problem was actually that I had an ' echo ' in my .bash_profile and .bashrc , which affected the protocol.
Removing the echo fixed the problem.

0

我刚碰到同样的问题。问题是,你会被分配外壳,面向对象的陷阱 - 用户做以下检查:

# replace leading tilde (~) with user's home path 
realpath = os.path.expanduser(thearg) 
if not realpath.startswith(config['GEAR_BASE_DIR']): 
    syslog.syslog("Invalid repository: not in openshift_root (%s) - %s: (%s)" % 
        (config['GEAR_BASE_DIR'], thearg, realpath)) 
    print "Invalid repository %s: not in application root" % thearg 
    sys.exit(3) 

所以git仓库必须是在让你只能用你的home目录GEAR_BASE_DIR。

要调试,不要像水木清华ssh yourmachine git-receive-pack /path/to/your/location

0

这里的一个关键问题是Git的配置文件,有问题的项目;问题是无法正确读取此文件以检索连接到存储库的必要信息。

你应该确保每行只有一个参数,并且没有任何杂散字符或空格。如果你在配置文件中发现了这样的错误,那么这个修复应该有助于缓解这个问题,并允许你再次访问这个版本库。