How to upload a local project to GitHub

Source: Internet
Author: User

The park has been opened for several months, has not applied for their own blog, usually also look at the technical articles Daniel. These days encountered a few problems, think of the park friends may also encounter, simply to share their own problems, one can help the park friends, and secondly can also give themselves a deeper impression. This is the first blog I wrote, what is not in place also invites the garden friends can put forward valuable suggestions, to improve, overland here first thanked.

This operation needs to use the management tool git,:https://git-scm.com/

Once installed, open the project folder you want to upload, right-click on the Windows system select Git Bash here

The transfer between 1.git and GitHub is encrypted via SSH, so the first step is to generate one locally. SSH (there is not much explanation for the GitHub registration steps here).

1) First check if there is a. ssh file on the local, and some delete it.

$ CD ~/.ssh

2) Enter the command, generate. SSH, write your own mailbox

Ssh-keygen "Your email @.com "

You can go straight to the carriage

This means that a. ssh file will be generated at the root of the user directory in the C drive, and if you can't find it, you can search for it, and there will be Id_rsa and Id_rsa.pug files under the file.

3) In order to avoid errors when creating a connection with GitHub, you can create a new config file and copy the following code in

Host github.com    User git    ssh. github.com    preferredauthentications publickey    ~/.  SSH/id_rsa    443
 

2. Add a public key to GitHub

1) Copy the contents of the Id_rsa.pug to the specified location

2) test the connection is successful, indicating successful access

ssh -t [email protected]

3. Uploading a project

1) Create git config file, you will find a. git file under your file, default is hidden file

$ git init

2) Add all current files to GitHub

$ git Add.

3) Confirm Add

" First commit "

4) Execute the command, and copy back the generated on your GitHub

$ git Remote add origin [email protected]:heshaui/pdfjsdemo.git

May be wrong

Workaround:

First enter: $ git Remote RM origin

Re-enter: $ git Remote add origin [email protected]:heshaui/pdfjsdemo.git

5) Execute last command

$ Git push-u Origin Master

So the project was uploaded successfully.

How to upload a local project 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.