Uploading local items to GitHub

Source: Internet
Author: User

Preface: Want to upload a local project to GitHub management, so here to record, convenient later.

The first step, create a warehouse on GitHub

The second step, go to the local repository, execute the GIT init command, this will be more than the. git folder.

The third step, in order to upload the local warehouse to GitHub, also need to configure SSH key.
$ ssh-keygen-t rsa-c "[Email protected]"

Direct to enter, here is the description will be generated on the default file Id_rsa ssh key.

Here the system requires a password, directly press ENTER to indicate that no password is set. Repeat the password is also a direct carriage return, after prompting you shh key has been generated successfully.

Fourth step, then we go to the prompt address under View SSH key file. My computer's address is c/users/administrator/.ssh/id_rsa.pub.

Open the Id_rsa.pub and copy the key inside. The key inside is a pair of characters that can not understand the combination of numbers, do not control it, directly copied.

Back to GitHub website, go to account Settings, choose ssh and GPG keys,new ssh Key on the left

Title fill, paste key.

After saving, verify success, enter in Git bash

$ ssh-t [email protected]

Enter will see: You've successfully authenticated, but GitHub does not provide shell access. This means that you have successfully connected to GitHub.

The fifth step, the next thing we need to do is to upload the local repository to GitHub, before you have to set up username and email, because GitHub every commit will record their
$ git config--global user.name "your name" $ git config--global user.email "[Email protected]"

Sixth step, go to the local Repository (folder), right-click Git Bash, add remote address

$ git Remote add origin [email protected]:yourname/yourrepo.git

Seventh step, finally, submit the code, upload

git Add. which. Represent all Files

The first time you upload the code, initialize the project, so you need to create a new branch master, or you will get an error.

The eighth step, on GitHub, looks like this, then you can start to maintain the warehouse.

Uploading local items 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.