Windows git server Setup [go]

Source: Internet
Author: User

As the first two days of the GIT server set up a collation, I would like to separate from the service side and the client two angles to record the entire building process, in order to achieve the goal, we need to what actions.

(a) installation configuration of server software and accounts

We only need two software git and SSH, the software version is as follows, these two versions of the installation is very simple, just pay attention to a little bit: The installation directory is best not to use the default path, ensure that there are no spaces in the installation path. The other steps are basic to next.

Git-1.8.1.2-preview20130201.execopssh_4.1.0_installer.exe

After the installation is complete, we are going to make a connection, mainly associated with git and ssh, because we are here to use the SSH protocol to connect to the server. The way to do this is to copy the relevant files from git to the bin directory in SSH.

Here are the two software installation directories

My git install directory C:\git
My SSH installation directory E:\ssh
Everyone according to their own installation directory, the following reference to the relevant path to adjust it
The list of git files that require copy is as follows:

C:\Git\bin\ Libiconv-2.dll

C:\Git\libexec\git-core\git.exe

C:\Git\libexec\git-core\git-receive-pack.exe

C:\Git\libexec\git-core\git-upload-archive.exe

C:\Git\libexec\git-core\git-upload-pack.exe

Copy these files to the bin directory of SSH, my corresponding directory is E:\ssh\bin

Next, we need to create an account on the server, the normal account can be, I created a regular account called Git.

With this account, we will then use the SSH Control Panel to create a corresponding SSH account, the corresponding steps are as follows:

  

  

As shown, here we choose the Special account you just created git

  

Note here that the first allow password authentication is not checked

  

Click Apply,ssh to create a successful account.

Now that the server has been configured, we can create a warehouse on the server for subsequent connection testing. Since we created an account called Git, there is a git directory in the home directory under the SSH installation directory.

Go to the directory, right-click Git Bash, and run the following command from the command line

  

1 mkdir myproject//Create my project directory, named Myproject2 CD MyProject//Enter the Directory 3 touch helloworld.txt  //Create a file in the directory for subsequent testing 4 git        Init//Initialize the repository 5 git Add. All files in the current directory are added to staging area 6 git config--global user.email "[email protected]"//Create global git account 7 git config–global user.name "Jason H Uang "//Create a global git account
8 git commit–m "init myproject Repo"//submit all files of the staging area to the warehouse and add comments

(ii) Installation and configuration of client software

As with the server, the client also needs to install Git.

After the installation is complete, you need to create a key pair, which is used primarily for authentication with the server connection. Step is simple, open git Bash, enter command Ssh-keygen, for subsequent command line prompt input, all the way to the default return.

Depending on the prompt, the default generated key pair is in the. SSH directory under the current user directory.

  

Next, in order for the server to recognize our public key, we need to upload the public key in the key pair to the server, and use Notepad to open the public key file id_rsa.pub just generated and copy everything inside.

Back to the server side, in the SSH account we created before git corresponding directory home/git/.ssh, new file Authorized_keys file, note there is no file suffix, paste the public key just copied into, save.

Finally, to ensure that server port 22 is open, if it is not open, go to the firewall configuration, at least ensure that inbound port 22 is open, because the default port for SSH connections is 22.

At this point, the client-related configuration is basically complete. We can start clone, create a directory, then git Bash, run the following command

Here my server IP address is 192.168.1.168

By the way, if the prompt "push to Origin/master is rejected" appears during the push process, the solution is to load the following configuration into the config file in the. git directory of the service-side project.

[Receive]denycurrentbranch = Ignore

That's all. The construction process encountered a lot of problems, from the great God of the article to learn a lot of nutrition, thank you for sharing, here I will also share my experience to everyone, save everyone valuable time.

You can try the next gitblit, one-click Deployment, with a web interface similar to GitHub. Of course it's a lot worse than GitHub.

Gee, what an old way it is. Recommended I developed the Gitcandy, in Windows next second to build the server.

Http://gitcandy.com
Https://github.com/Aimeast/GitCandy

Windows git server Setup [go]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.