[TOC]
Build git-server service on Windows system
Use git for Window and CopSSH
Windows 10 and Windows 2008 Server R2 have been tested
Install Git for Window
-
Open the Git installation software
-
Select the installation path, I will select the default installation path
-
All the way down next until the software is installed
Step 2: Install CopSSH
-
Open the CopSSH installation software
-
Select the installation path, I will select the default installation path
-
Set up a user and password that you want to connect to over SSH, and change it to one that you can remember
On the Window Server, the user password must meet the required password format; otherwise, the user will not be added
-
During the installation process, click ok, you will find that there are two more copssh users
Step 3: Configure the CopSSH configuration
-
Open the COPSSH Control Panel
If the service status is red, uninstall CopSSH, delete the users added by CopSSH from the user list in the computer management panel, and perform step 2 again
-
Click on the Add button
-
Select the user to add
-
All the way forward, finally apply, and register the system users with the SSH service
Step 4: Test whether the SSH service is normal
Run SSH [email protected] to test whether the local SSH service is normal. If the SSH connection succeeds, the user on the cli is switched to mgit
Enter the PWD command on the command line to view the current position
In this case, the root directory of the command line corresponds to the CopSSH installation directory
Step 5: Set up git-server
-
In step 4, under the PWD output address, run mkdir code && CD code && git init –bare code.git on the command line
-
Switch to the directory where you want git clone and run the git clone command
The error message is lack of executable command.
Copy all files in the mingw32\libexec\git-core folder in the git for window installation directory to the bin folder in the CopSSH installation directory. If there are duplicate files, skip them
-
Execute the above command again
Q&A
remote host identification has changed
The SSH connection location is not in the /home/[user user name] directory
If the user is installed using CopSSH, the connected directory will be under /var. If you create a user manually, the directory will be under /home/[user username] after the connection
fatal: does not appear to be a git repository
Git clone usr @ host: path/to/gitRepository (path/to/gitRepository is relative address after SSH connections to the directory)