2012-10-13 108 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的配置文件,有問題的項目;問題是無法正確讀取此文件以檢索連接到存儲庫的必要信息。

你應該確保每行只有一個參數,並且沒有任何雜散字符或空格。如果你在配置文件中發現了這樣的錯誤,那麼這個修復應該有助於緩解這個問題,並允許你再次訪問這個版本庫。