Basic configurations of Git and Github (Windows Version)

Source: Internet
Author: User
Tags git commands

By freeuniverser

I don't want to talk about the competition between Windows, Linux, and other operating systems. I just want to say what is best and how to come with you. They are all just tools, there is no need to become a slave of tools. Of course it will be better. This article uses Windows as an example to describe the simple configuration of Git and Github.

Version control tools are used to solve synchronization problems and record history and processes. Such tools are also used in many ways, like programming languages and operating systems, select your preferred one.

Here we provide one. Of course, you can download it from many places. It depends on yourself. Of course, it will be better to download the source from a good one, and the version will also be based on your own needs.

Installation is basically the next step. This is similar to the command entered in linux, but it is encapsulated. In this process, you can choose your own as needed.

Then create your directory:

$ mkdir YourGit

Enter the directory:

$ cd YourGit

Create a repository in the current directory:

$ git init

OK. An empty warehouse has been created. In fact, you will find that a lot of commands are very familiar, so are the program languages, the basic logic mode is the same.

For details about Git commands, refer to the following link:

Link 1:Git Reference

Link 2:A tutorial introduction to Git

Configure Github below. A good Git website is also a good place for learning and communication.

Register an account and configure SSH Keys

First check whether there is:

$ cd ~/.ssh

If not, create it:

$ ssh-keygen -t rsa -C "your_email@example.com"

A message is displayed:

Generating public/private rsa key pair.Enter file in which to save the key (/c/Users/you/.ssh/id_rsa):

The default disk is drive C. You can choose it by yourself. We recommend that you press enter directly by default. To be honest, configuration is a very tedious task, which is more convenient for Linux.

Then the system prompts you to set the password:

Enter passphrase (empty for no passphrase):Enter same passphrase again:

The following prompt is displayed:

Your identification has been saved in /c/Users/you/.ssh/id_rsa.Your public key has been saved in/c/Users/you/.ssh/id_rsa.pub.The key fingerprint is:01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com

Obtain:

$ clip < ~/.ssh/id_rsa.pub

Then bind it to Github:

Account settings:

Find SSH Keys:

Add SSH Keys:

Test successful:

$ ssh -T git@github.com

There may be a warning:

The authenticity of host 'github.com (207.97.227.239)' can't be established.RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.Are you sure you want to continue connecting (yes/no)?

Yes, and you will be prompted to enter passphrase, OK!

Hi username! You've successfully authenticated, but GitHub does not provide shell access.

The configuration in linux is similar and much better than the command line environment in windows. If you want to use a graphical interface (of course, Git For Windows has a GUI), you can download a Tortoisegit file, however, the command line interface is more concise.

In fact, a lot of configuration environments are very simple, but the specific operations are often stuck in a certain step, this really requires patience, but do not become a slave tool.

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.