git installation steps

Source: Internet
Author: User

Git easy to use instructions to install Git

Msysgit is a Windows version of Git, downloaded from Https://git-for-windows.github.io, and then installed by default (note: Install a git file that is appropriate for your computer version).

After the installation is complete, find Git Bash in the Start menu and pop out a command-line window that shows that the GIT installation was successful!

After the installation is complete, you will need the final step, and at the command line, enter:

$ git config--global user.name "Your name"

$ git config--global user.email "[Email protected]"

For example:

$ git config--global user.name "xxxxxx"

$ git config--global user.email "[email protected]"

Connecting to a remote repository

1th step: Create SSH Key. In the user home directory, see if there is no. ssh directory, if there is, then look at this directory there are no Id_rsa and id_rsa.pub these two files, if already have, can jump directly to the next step. If not, open the shell (open git Bash under Windows) and create SSH Key:

$ ssh-keygen-t rsa-c "[email protected]"

You need to change the email address to your own email address, and then return to the default value, as this key is not used for military purposes, so there is no need to set a password.

If all goes well, you can find the. SSH directory in the user's home directory, there are Id_rsa and id_rsa.pub two files, these two are SSH key key pair, Id_rsa is the private key, can not be leaked out, Id_rsa.pub is the public key, can be assured to tell anyone.

2nd Step: Login Gitlab (http://192.168.3.249) Enter personal settings click Add SSH key

Then, fill in any headings and paste the contents of the Id_rsa.pub file in the Public key text box:

Why does GitHub need SSH key? Because GitHub needs to recognize that your push submission is actually pushed by you, not someone else impersonating it, and Git supports the SSH protocol, so if GitHub knows your public key, you can confirm that only you can push it.

Of course, GitHub allows you to add multiple keys. Assuming you have a number of computers, you can submit them at the company in a moment, and at home, just add each key to GitHub and push it to GitHub on every computer.

Cloning a project to a local

In the directory where you want to clone, right-click "Git Bash Here" and enter the command you want to clone in the GIT command-line window that pops up: (The following items are used for Git testing, you can create, upload, etc. on this project)

git clone [email protected]: Ceshigroup/gittest.git

After the command is executed, you will see a directory that generates a gittest

Add File command

git add readme.txt

Submit command

Git commit-m "Description of this submission"

(You should write a description of the changes each time you submit, what you have submitted, what you write, and what you can do to track later)

Push Branch to remote warehouse command

Git push origin master only pushes someone else to see your code

Fetching branches from remote

Git pull

This document is a simple explanation, and a detailed tutorial can refer to

http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000

git installation steps

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.