Connect and sync the git repository under Windows

Source: Internet
Author: User
Tags openssh server using git git commands

1. Requirements

Computer A and Computer B are supposed to synchronize the working directory through the server. Server when there is a bare warehouse on the Linux system, whether on a or b work, after the work is finished using git go and the Server warehouse synchronization. A and B are Windows systems, in the working directory there is a git brutal, inside the config file is similar to the Remote connection command "URL = Ssh://[email protected]:22/home/user/gitlib/ww.git". Since we only run GIT commands on Windows to interact with the server, there is no need for the SSH service process on Windows.

Now, because of the server problem, you want to sync through the U disk. Of course, the synchronization process is still using Git. The initial intention is to install the SSH service on Windows, and then write the path of the U-disk into the URL above.

2. First try to use the Linux subsystem under Windows 10, method

(1) In the Control Panel-"Add/Remove Programs-" on/Off feature, select the Linux subsystem, reboot. Then search the App Store for Ubuntu installation

(2) Run Ubuntu, wait for the installation to be successful, set the user name and password. Use sudo passwd to set the root password.

Using this method is equivalent to using the Linux,win disk default is mounted under/MNT, we should also be able to hang on the U disk.

Use this method every time you need to open the Linux subsystem.

3. We only want to use the SSH service. Win10 comes with OpenSSH. Add the OpenSSH server to the Add function in Settings-"apps-" apps and Features-"manage apps and Features-" and then install. After installation, set it to start in the service and set it to start automatically.

Then, you can use Xshell to log in to the machine. The user name and password are the Windows user name and password. Note that if the win user does not have a password set, the password should be set before SSH login.

After logging in, the default is a cmd-like command line, Revenue bash enter the Linux command line, you can enter the general Linux shell command. Using mount, you can see that the win's disk is mounted under/MNT.

Suddenly found that, although the user logged in with win, but after running bash, is the 2nd step above the Linux users set, the root password is also set there. So it seems necessary to enable the Linux subsystem.

4.

  

Connect and sync the git repository under Windows

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.