Uploading a local project to GitHub

Source: Internet
Author: User

Step one: Add Keys to GitHub

To generate a local key:

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

When the command executes, it prompts for the location of the generated. SSH folder, enters the open id_rsa.pub file, and copies all of the contents.

Add encryption Key:

Go back to GitHub, enter settings under your avatar, enter ssh,new ssh key, fill in the title, and paste the copied key.

Step Two: Local project upload:

1. Execute git init under project ROOT to convert the project into a Git project (Add. Git folder in the project).

2. Configure the submitted user name and mail address in the project root directory:

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

3. Execute under Project root (Create new new repository on GitHub, named Project):

Git remote add Origin https://github.com/yourname/Project.git

After executing the command, add the following to the. git/config file:

[Remote "origin"]url = Https://github.com/yourname/Project.gitfetch = +refs/heads/*:refs/remotes/origin/*

4. Execute the submission process:

git Add. Git commit-m "first commit" Git push origin Master (need to add parameters, follow direct git push)

After executing the. git/config file, add the following:

[branch "master"]      Remote = origin      merge = Refs/heads/master

Upload completed

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