From 9dfa242fa21ca99eda19894ef0f44a0e0722327e Mon Sep 17 00:00:00 2001 From: Yanbing Date: Wed, 27 Sep 2017 13:07:20 -0700 Subject: [PATCH] Updated Setting up a Git server on Windows using Git for Windows and Win32_OpenSSH (markdown) --- ...Windows-using-Git-for-Windows-and-Win32_OpenSSH.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Setting-up-a-Git-server-on-Windows-using-Git-for-Windows-and-Win32_OpenSSH.md b/Setting-up-a-Git-server-on-Windows-using-Git-for-Windows-and-Win32_OpenSSH.md index 746730b..6b7e651 100644 --- a/Setting-up-a-Git-server-on-Windows-using-Git-for-Windows-and-Win32_OpenSSH.md +++ b/Setting-up-a-Git-server-on-Windows-using-Git-for-Windows-and-Win32_OpenSSH.md @@ -10,12 +10,9 @@ ``` 1. Restart sshd so the changes to the `Path` environment variable can take effect. 1. Create Windows users for all Git users. -1. Create a central Git repositories - * Go to where you want to create a central repo, `git clone --bare ` A directory with name `.git` will be created. In it will be the .git contents of your source dir repo. for example: +1. Create a central Git repository. Go to where you want to create a central repo, `git clone --bare `. A directory with name `.git` will be created. In it will be the .git contents of your source dir repo. for example: - ``` - git clone --bare c:\git\newrepo.git - ``` + `git clone --bare c:\git\newrepo.git` 1. If you already have user private and public keys, copy the public key to C:\Users\{user}\.ssh\ and rename it to authorized_keys ## On Client 1. Set environment variable for git to use Win32_OpenSSH @@ -26,13 +23,13 @@ `ssh-add.exe ` 1. To check out a repository: -**Note that `git clone username@domain@servermachine:C:/test/myrepo.git` does not work due to [known issue](https://github.com/PowerShell/Win32-OpenSSH/issues/895). Work around it by following steps: +**Note that `git clone user@domain@servermachine:C:/test/myrepo.git` does not work due to [known issue](https://github.com/PowerShell/Win32-OpenSSH/issues/895). Work around it by following steps: # initialize a local repo folder git init mylocalrepo cd mylocalrepo # add the remote repro - git remote add origin username@domain@servermachine:C:/test/myrepo.git + git remote add origin user@domain@servermachine:C:/test/myrepo.git # work around the known issue by launching powershell to run the git commands git config --local remote.origin.uploadpack "powershell git-upload-pack" git config --local remote.origin.receivepack "powershell git-receive-pack"