Uploading local files to GitHub

Source: Internet
Author: User
Tags using git

1. Configure identity

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

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

To see if the configuration was successful

$ git config--global user.name

$ git config--global user.email

2. Using Git to build a code warehouse

(1)$ cd E //Enter the disk where the local file is stored, e disk here

$ cd Java/uilayouttest //Enter the folder where the local files are stored

(2) Create a warehouse

  $ git init //will generate a hidden. Git folder at the root of the project, which is used to record all git operations on the ground, available $ ls-al view

(3) Add local code to library

  $ git Add. //. Indicates that all files are added

(4) Submit

$ git commit-m "first commit"

3. Generate SSH Key

(1) Check if SSH key is generated (usually installed by default)

$ ssh

(2) Specify the RSA algorithm to generate the key

$ ssh-keygen-t RSA after three consecutive returns, Id_rsa.pub found in/c/documents and settings/username/.ssh (hidden file)

(3) Add SSH key to GitHub

Set--ssh and GPG keys--new SSH key--Paste the contents of Id_rsa in key

(4) test whether the link is successful

$ ssh-t [email protected] //hint hi defnngj you ' ve successfully authenticated, but GitHub does not provide shell access . It means you're connected.

4. Uploading items to GitHub

(1) Create a new project on GitHub

(2) Associating a local project with a project on GitHub

$ git Remote add origin [email protected]:sunying225/uilayouttest.git

(3) Ensure that both ends of code are synchronized

$ git Pull--rebase Origin master

(4) Upload code

$ Git push-u Origin Master

Uploading local files to GitHub

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.