Using Git summary under Windows

Source: Internet
Author: User
Tags git client ssh server using git version control system sourcetree

first, build a git server under Window


1, Cyswin this simulation environment. There is already a git service in this package (now my git is in it.) )

2, also need the SSHD server to line. There's a bag inside.

3, the relationship between the GIT server and the sshd server

If the GIT server is connected with an SSH protocol, you do not need this form: specifically start the GIT server as a process, listening on a port.



The idea is: only need to configure the sshd server, listen to a port, focus on the public key to Authorized_keys. Into the form of an SSH client connected to the SSHD server.
If you can connect, see if the public key in the Authorized_keys matches.


SSH public key is in effect, the. SSH directory permissions must be 0700,. ssh/authorized_keys file permissions must be 0600

git clone ssh://[email protected]:/path/test.git/

The GIT client should connect to the SSH server and take "/path/test.git/"





4. Configure the SHHD step under Cyswin
In the Syswin console input
The Ssh-host-config-y #将sshd注册为系统服务, and the settings become auto-start.

In the Syswin console input

NET Start|stop sshd

Seems to be: SC start sshd

or SC sshd start
If there is a problem, you can remove the service and reinstall

Delete Service: SC delete sshd

Experience: To be able to use net, the key is to enter the name of the Damon when running Ssh-host-config.






\etc\sshd_config configuration.


The public key is added to the
Home\administrator\.ssh\authorized_keys











second, use the Git client under window


This form is just a client, and the GIT server may be on a local window or on a remote Linux platform.


Git bash is a git client.

Go to the http://msysgit.github.io/website to download a "Git for Windows", which is already compiled binary.

git for Windows is compiler-free because it has been pre-compiled to fit the binary of the window platform. So you can directly click on the next step in this way to install.

It's not the same thing as Msysgit.


Msysgit's homepage offers two items: Git for Windows and Msysgit.



After installing Git for window. This software will have two components: Git bash and git gui.






Watch out.

1, when the installation will be asked to choose which as the SSH client. There are two options: Plink and OpenSSH (this is the default)

The client selection differs and affects how the key is parsed. Select OpenSSH.


Echo $GIT _ssh
See which client is being used.


2. If you have already installed, you should modify the SSH client. Under GIT Bash command Line input: Export git_ssh= '/f/installsoft/git/git-for-windows/bin/ssh.exe '

This is only a temporary modification. To take effect permanently, add this sentence to the \git-for-windows installation directory \etc\profile file

Export git_ssh= '/f/installsoft/git/git-for-windows/bin/ssh.exe '

After you modify the profile, you need to run "source \etc\profile" to take effect




Run git [email protected]:test.git

Git bash will connect to the SSHD server according to the set SSH client.



What private key is used to send to the server? If you use Ssh.exe as the SSH client, it is configured in the ~/.ssh/config file.


3. Generate Public key

Ssh-keygen-t "[email protected]"-f/f/install/git/mykey/id_rsa_first

If you do not specify-F, the default is to generate to the ~/.ssh/directory, the default name is Id_rsa (Id_rsa and id_rsa.pub two files, corresponding to the private key and public key)



It is recommended to use the Pure command line feature. Some features are not implemented because of the graphical interface. Using pure commands makes it easy to know the principle.



git config--global user.name ' Wangtao '
git config--global user.email [email protected]
Setting up the configuration

Iii. collating the relationship between the tools on the market

Http://git-scm.com/download, this is Git's official website.

This is the official website of a client tool: http://msysgit.github.io/. This is actually the use of git into a convenient window below. Integrated: Git bash and git gui.

Msysgit is the version of the Git version control system under Windows.

Historically, Git on Windows is only officially supported using Cygwin. To help make a native Windows version, this project is started, based on the MinGW fork.
Only Git that runs under Cygwin.
Includes: Git bash, git gui

Msysgit has a simple GUI tool and simple Explorer integration, but its own Bash is very easy to use and has won the true line of Linux.

GitHub uses a git distributed version control system, and Git was originally created by Linus Torvalds to help with Linux development, which is for Linux platforms, so git and windows are never the best friends because it's not like windows 。 GitHub released GitHub for Windows, providing an easy-to-use Git graphics Client for Windows platform developers.


before installing Tortoisegit, you must install Msysgit

Some say: Tortoisegit is the encapsulation of the Msysgit command line, so you need to install Msysgit first.

Why doesn't tortoisegit, like TortoiseSVN, integrate the SVN command-line tool into the installation package? I guess the following are some reasons:

Git has never officially been out of Windows version binary packages;
Msysgit and Tortoisegit were developed by two different teams;
The renewal period of Msysgit and Tortoisegit was significantly different;
The Tortoisegit team expects the installation package to be smaller;
The Tortoisegit team gives users the flexibility to choose the Git version right.


Tortoisegit is just a GUI tool that uses it to install Msysgit first, which is the authentic version of Git Windows。 Msysgit has a simple GUI tool and simple Explorer integration, but its own Bash is very easy to use and has won the true line of Linux.


Tortoisegit provides a good interface for git, which actually uses the Git-1.7.4 client to complete all Git functions

Git-1.7.4, this is a git client that can be downloaded from Git's official website

What is the relationship between Tortoisegit and Msysgit? Will ultimately depend on git?
I can understand that these two things are better for Windows users to use the GIT service.

Tortoisegit is a good git client tool under Windows, it is recommended to use Sourcetree under Mac (Sourcetree does not support WINDOWXP, only supports WINDOW7)
Sourcetree is a well-known Git GUI tool on the Mac platform, and the version under Window (Win7) is also available.
There is also a tower under the Mac, a powerful git client.


Git GUI clients: is a generic term. Does not specifically refer to which operating system platform. It is a graphical version of the Git client. In fact, the command operation is omitted. To make graphics. A lot of git GUI clients are listed on the GIT website. GUI clients This is the name of the official website. All GIT clients are graphically called Git GUI clients. Graphical clients on all platforms on the market. There are Linux also under Windows.


The Git GUI is the git server-side graphical management tool under window. There will be two after msyssit installation: Git bash and git gui (graphically managed server version)


Two salutation: Git bash and git gui. git gui embedded in git bash.


Windows version of Git server: Msysgit, Gitstack

Understand this: Because Git official only provides the source package to compile installs. No installation is done specifically for Windows. Not friendly. So some companies have made a window-based version of themselves, such as Msysgit.

As Msysgit official website says: We bring the awesome Git SCM to Windows.


Window version of the GIT client (graphical interface and Shell interface): Git bash, tortoisegit, GitHub for Windows, Sourcetree

Git GUI tools under other operating systems:

1, GitHub This company also made for Mac system under the graphics client, GitHub for Mac. To differentiate, so called for Windows
2. Tower
3, Gitbox
4, Gitx-dev

5, GITG Linux platform under the graphics client.

Git comes with built-in GUI tools for committing (Git-gui) and browsing (GITK)

Built-in GUI tools are used to submit and browse versions.

Several SSH clients:

Tortoiseplink, is an SSH client.

And OpenSSH, this is a turtle git built-in SSH client. Tortoiseplink comes from putty this software.

When you install Git, you are prompted to use the Plink client or the OpenSSH client.

Using Git summary 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.