Git usage record

Source: Internet
Author: User
Tags git client using git

Using Git under Win7.

Installation will not repeat the following document is said to be very detailed

Git client diagram details how to install the Configure GitHub how-to Http://www.ihref.com/read-16377.html

To the next step, choose the second one, so that right-click Git options


Configure Sshkey to create a local SSH
Ssh-keygen-t rsa-c "Registered email"

GitHub mailbox: The mailbox behind this command is the registered mailbox of GitHub;
Path selection: After using this command, you will be prompted to select the Ssh-key build path, where the direct click to enter the default, the generated Ssh-key in the default path;
Password Confirmation: Here we do not use a password to log in, with a password too troublesome;

Configure SSH to GitHub

Enter the generated SSH directory: C:\Documents andsettings\administrator\.ssh (or C:\Users\ own computer user name \.ssh), use Notepad to open the Id_rsa.pub file and copy the contents of the file ;
Id_rsa.pub file content: Go to GitHub website: Login to GitHub, select account Setting user settings:

Select the Ssh-key option on the left:

Click on the Add SSH key on the right:

Copy the Ssh-key copied in:

Note: The win user needs to add the config file, (otherwise bad number file will appear) specific parameters you follow your own,

My content is as follows,


Here the port can not add or set to 443, or 80, there are 1234356, some do not add, because our server needs to change places, to the hospital server as an example

Note: Host is our public IP address, user is your account name in Gitlab, the third line is not tube, the fourth line is the location of your public key file, if the bad file number needs to add a line prot 443, or port 80

To verify that the configuration is successful with a hospital server as an example:


Note: The first time the option input Yes is present

Validation may allow you to enter Yes.

Success prompt: If the hi "yourname" You have successfully authenticated, but GitHub does not provide shell access. This indicates that the configuration is successful and can be connected to GitHub;

You have to be successful, or you can't do it later.

Configure Local Users and mailboxes

User Name Mailbox role: We need to set a username and mailbox, which is used to upload a local repository to GitHub and display code uploader on GitHub;
Use the command:

git config--global user.email "registered mailbox"//Set up a mailbox

The GIT client has been installed and the GitHub configuration is complete, and now the code can be transferred from GitHub.

Uploading files

First, login to the Gitlab homepage to create a new project

Taking the lte/lte-powerpc.git of Tong Yuan as an example


To upload a file:

Open Gitbash

CD to the directory of the files to be transmitted

Git init

git remote add origin [email protected]:lte/lte-powerpc.git (The parameter here is the warehouse parameter of the corresponding project)

(Origin exitss input git remote RM origin, execute the above statement again)

Git pull Origin Master

git Add File

Git commit-m "Comments"

(Error: ' Commit ' isn't possible because you have unmerged files. Enter Git add-u)

Git push Origin Master

(git clean-d-fx)

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Git uses records

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.