Build Gitolite server through Cygwin in Windows environment

Source: Internet
Author: User
Tags ssh access

This article references: http://blog.csdn.net/benkaoya/article/details/8884677

Background:

Our team was even using VSS before contacting Git last year, and the outsourcing team introduced git in an outsourced project because of the need to work closely with the outsourced team.

After that, all of our projects migrated to Git because of the growing size of the team and the powerful branching capabilities of git.

After that, the new people continue to join, the leaders concerned about the issue of authority, our server administrators consider using Gitsis or gitolite, but find data research after a turn to feel too cumbersome, has been shelved.

Then, after the leader considered using SVN as the Project management tool, I decided to look at Gitolite. Direct installation OpenSSH after failure, decided to use Cygwin

Cygwin official website: http://www.cygwin.com/

Package Mirroring node: http://mirrors.163.com/cygwin/

Required Package:editors->vim, NET->OPENSSH, DEVEL->GIT/GIT-COMPLETION/GIT-GUI/GITK

Body:

The tutorial in the beginning of the reference link is already very detailed, here is mainly to record my 3 times to build the service side of the pit (in fact, the main 1 of the pit).

1. Install Cygwin, download from official website

  Tip: To choose a Download site This step must choose 163 of nodes, otherwise, in addition to the above 6 need to have some packages outside, with foreign nodes at least one or two hours

  If there is no 163 image in the list or the optional list is empty directly, add the address above

2. After the installation is complete, run the CYGWIN.BAT,CD in the Cygwin installation directory to the bin directory, then execute the cyglsa-config, restart the server

3. Configure the SSH service, open Cygwin again, execute Ssh-host-config

The latest version of the OpenSSH more than a strictmodes open inquiry, its recommendation is yes; yes;*** Query: Enter The value of CYGWIN for the daemon: [] Direct carriage

Ssh-host-config will create an sshd service and a cyg_server account to run the service

  TIP1: When creating an account, be sure to pay attention to the strength of the password, if the password is not strong enough to cause the creation to fail, then the service will not run.

  Here a pit is, the default hint of Chinese is garbled, causing you do not know what is wrong. Right-click Cygwin form, Options->text->locale:zh_cn,character SET:GBK

  TIP2: Do not create the user in the control Panel itself, or it may be due to permissions problems can only run the SSHD service account to SSH access to the server

(Here is really the pit of my more than 10 hours ah, all kinds of chmod, chown, all kinds of egg pain can not find the solution to SSH connection)

4. Create an account user SSH access (standard user can), such as Git, execute command: mkpasswd-l-u git >>/etc/passwd

5. Install Gitolite, there is nothing to say, no longer AO

6. Done, you can work on Git

Summarize:

When I first installed gitolite in this way, it went well.

But the second time because Cygwin will not automatically help you create the Cyg_server account, and I entered the password strength is not enough to cause the creation failed, and then I created the Cyg_server this account with him to run the sshd service

So SSH link cyg_server account is normal, connect other account will always error/bin/bash permission problem, a connection is disconnected, and finally have to use the account to run the SSHD service

Finally, when configuring SSH on the test server, we learned the lesson and successfully completed the configuration. 10 minutes of skilled configuration can be done.

The reason why we need three times to install Gitolite, is because our test server is the production environment on the hard drive out of the bad, a reboot will not come, can only format the hard drive reload, after 2 toss finally changed the block hard drive ...

After these several times, and more determined that I use Git as a version of the tool, from the point of view of disaster, the server in the case of a complete no backup can also be a perfect recovery work.

After the Gitlite is installed, the 2 innings command can restore GIT permissions and projects.

Under the Gitolite-admin project: Git push-f

Under the GIT project: git push--all

Next time, want to study the Gitlab.

Build Gitolite server through Cygwin in Windows environment

Related Article

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.