2012-03-12 10 views
8

मेरे पास Windows 2008 R2 सर्वर मानक संस्करण है। मेरे पास गिट के साथ फ्रीएसएसएचडी स्थापित है। विंडोज फ़ायरवॉल में पोर्ट 22 पर सेट अपवाद हैं। मेरे पास केवल एसएसएच सार्वजनिक कुंजी स्वीकार करने के लिए एसएसएच सर्वर सेटअप है। मैं टर्मिनल का उपयोग कर सर्वर ठीक से लॉगिन कर सकता हूं (यानी ssh [email protected])।घातक: प्रोटोकॉल त्रुटि: खराब रेखा लंबाई वर्ण: Unab

fatal: protocol error: bad line length character: Unab

मैं क्या यह पैदा करने के लिए के रूप में एक निरपेक्ष नुकसान में हूँ: जब मैं git clone आदेश का उपयोग करने के लिए जाना (जैसे git clone ssh://[email protected]/path_to_my_repo) मैं इस त्रुटि मिलती है। मेरे पास शैल, एसएफटीपी और सुरंग प्रोटोकॉल सक्षम हैं।

+2

शायद यह? http: // stackoverflow।कॉम/प्रश्न/8170436/गिट-रिमोट-त्रुटि-घातक-प्रोटोकॉल-त्रुटि-खराब-रेखा-लंबाई-वर्ण-unab – ellotheth

उत्तर

4

फ्रीएसएसएचडी भूल जाओ। इसे गिट के साथ चलाने के लिए कॉन्फ़िगर नहीं किया जा सकता है।

आप दो (जहाँ तक मैं मिल सकता है) विकल्प हैं - विंडोज के लिए एक और अधिक परिष्कृत SSH सर्वर के साथ जाने के लिए और उसके बाद यह लागू: http://holyhoehle.wordpress.com/2011/01/26/setting-up-a-git-server-on-windows-server-2008-r2-using-msysgit-and-winsshd/

या (CopSSH)

http://java2cs2.blogspot.de/2010/03/setup-git-server-on-windows-machine.html

OpenSSH के साथ जाना

http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/

Setup a Git server with msysgit on Windows

http://code.google.com/p/tortoisegit/wiki/HOWTO_CentralServerWindowsXP

+1

बेली गई प्रतिक्रिया, लेकिन सोचा कि मैं उल्लेख करता हूं कि WinSSHD का उपयोग कर उपर्युक्त मार्गदर्शिका मेरे लिए काम करती है। मैंने हमारी टीम के लिए तीन-स्तरीय देव, क्यूए, पीआरडी प्रणाली लागू की है। हमारी जरूरतों के लिए पूरी तरह से काम करता है। – gwrichard

2

एसएसएच पर गिट एसएसएच पाइप वर्बैटिम के आउटपुट का उपयोग करता है। यदि उस आउटपुट में गिट से संबंधित कोई नकली डेटा नहीं है, तो गिट कमांड उस पर पार्स करने में असफल रहता है और एक अस्पष्ट त्रुटि संदेश के साथ बंद करता है। ऐसा तब हो सकता है जब आपके पास कोई उपयोगकर्ता स्क्रिप्ट है जो कनेक्ट होने पर सामान प्रदर्शित करती है, उदाहरण के लिए, या अगर कुछ गड़बड़ द्वारा त्रुटि संदेश को नहीं फेंकता है।

आप ध्यान दें कि 'अनब' 'असमर्थ' की शुरुआत की तरह दिखता है, संभवतः एक इंसान के लिए एक त्रुटि संदेश, गिट नहीं, वास्तव में।

जब आप निम्न आदेश चलाते हैं तो क्या होता है?

ssh [email protected] git-upload-pack '/path_to_your_repo' 

सिद्धांत में आपको 'अक्षम' से शुरू होने वाला त्रुटि संदेश प्राप्त करना चाहिए। उदाहरण के लिए, 'गिट-अपलोड-पैक ढूंढने में असमर्थ'। इस मामले में फिक्स आपके पथ पर गिट-अपलोड-पैक जोड़ना होगा!

0

मैं अपने काम में एक ही समस्या आज था ... इसलिए मैं इस पाया: Setting up a Git Server on Windows Server 2008 R2

क्या आप देखने की जरूरत नीचे है:

Making Git work on the server:

  1. If not already done, install msysgit on your server (I would recommend to install it directly to C:\Git or at least a path that has no spaces because I had some weird issues with “spaced” paths)

  2. Add C:\Git\bin to the PATH variable. This is very important!! sh.exe and other dependencies are in this folder

  3. Now go to C:\Git\bin and add the following two files

gup.sh grp.sh 4. Open gup.sh in your favorite editor and insert

C:/Git/libexec/git-core/git-upload-pack.exe $* 5. Open grp.sh and insert

C:/Git/libexec/git-core/git-receive-pack.exe $* The $* essentially rips off the single quotes from the repository path argument, so a path that has spaces in it won’t work here either I guess

Basically we’re done now and all git operations from the client should work. For a clone you have to type

git clone -u 'sh gup.sh' ssh://[email protected]/path/to/myrepo.git or a push would be

git push --exec 'sh grp.sh' ssh://[email protected]/path/to/myrepo.git but that is not very elegant.

Cleaning things up:

  1. At first we want to get rid of the whole repo path by specifying a remote alias

git remote add origin ssh://[email protected]/path/to/myrepo.git Where “origin” would be the alias name

  1. Next we set the config for the git-upload-pack and git-receive-pack so we don’t have to reference the shell script all the time.

git config remote.origin.uploadpack 'sh gup.sh' and

git config remote.origin.receivepack 'sh grp.sh' That’s it. Now we can use the normal git commands without any additional parameters:

git clone origin git push origin master git pull origin ...

0

मेरे मामले में, मैं था एक

echo $HOSTNAME 
मेरी .bashrc में

और .bash_profile है कि मैं कुछ कनेक्शन समस्याओं का निदान करने का उपयोग कर रहा था। जब मैं एक ssh रेपो से git pull करने की कोशिश की

fatal: protocol error: bad line length character: [VSR 

: यह मैं संदेश दिया। echo कथन को हटाने से चीजें काम करती हैं; [VSR 'echo से पहले 4 वर्ण हैं।

संबंधित मुद्दे