EZ PZ
EZ PZ

Reputation: 99

Need help setting up a git server on windows

i'm trying to set up a git server on Windows, but i'm having some issues getting it all to work.

I have locally created a normal repository, and remotely i created a bare repository. On the local repository i added a single text file and committed it, but when I try to push it into the remote repository I always get the following message:

fatal: protocol error: bad line length character: fata

I searched SO and other sources, and most of them suggest it's an issue regarding command echos. I'm using freeSSHd as a SSH solution (remote repository is hosted on a windows server), and I tried to use both the git bash and the windows CMD as a command shell.

I start CMD with /Q to disable echoing and /K to change directory to a directory where repositories are located, so I don't think that would be a problem.

Using the remote desktop, i can clone the repository to a folder next to it, and using the git bash locally i can access the SSH shell and also clone the repository in the same way. But using git clone ssh://<address>:/myRepo.git I always get the above message (The SSH's working folder is the same where the repository is located). Does anyone have any idea what's going on? How can I see what command is triggering the error, and how can I see the full error message?

Upvotes: 0

Views: 375

Answers (1)

Landys
Landys

Reputation: 7767

I also met the same error using freeSSHd as a ssh solution for git server on Windows. I couldn't find a solution for a whole day and gave up. :(

Later I found another powerful ssh server from Bitvise called WinSSHD worked well. It has free version for personal use. I suggest you to switch to it. Though I'd also like to know if there's a fix to the error we both met.

To setup ssh server with WinSSHD is quite simple, and you can add virtual accounts with private/public key access.

The key part is to setup the ssh access for git server. Please follow the steps of the blog here.

It should work well for Windows git client. For Mac, you may meet an error as follows.

grp.sh: No such file or directory
fatal: Could not read from remote repository.

To fix it, you need to create the two files gup.sh and grp.sh in your git bin directory (GIT_PATH/bin or GIT_PATH/libexec/git-core configured in system environment variable PATH) in your git server.

The content of gup.sh:

git-upload-pack.exe $*

The content of grp.sh:

git-receive-pack.exe $*

Upvotes: 1

Related Questions