Local code uploaded to GitHub

Source: Internet
Author: User

One, register your github account

1. Register an account first, register the address: https://github.com/

2. After logging in, click Start a Project

3. Create a repository name, enter the box name (not in Chinese)

4. Point create Repository was created successfully, as follows

Second, install Git

1.git is a tool for local client management code: Https://git-scm.com/download/win

2. Download to the local computer, all the way to install the Fool Next->next->-next

3. After the installation is complete, create a local folder, such as GitHub, and enter CMD in the File Address field.

4. After opening the DOS interface, enter git and see the following interface to show the installation success

Third, the local warehouse

1. Back to the previous GitHub interface, here are a few instructions to tell us how to upload the local code:

Git initgit add readme.mdgit commit-m "First commit"https://github.com/merryd/test.gitgit push-u Origin Master   

2. Put the code you need to upload in the GitHub file directory you created above, and then follow the steps above to get started

First step: Git init--opening a position

Step two: Git add *-Add code to the local repository (* code to add all updates)

Step three: Git commit-m "First commit"--commits to the local cache ("quotes indicate what is being submitted")

(First use will prompt: Please tell me who is)

If you see the above hint, continue knocking the two lines in cmd:

>git config--global user.name "[email protected] (your github mailbox)"

>git config--global user.email "your GitHub user name" (after the knock, continue with the commit step above)

Fourth step:git Remote add Origin Https://github.com/merryd/test.git-Submit to remote GitHub (at the back of the address, Is the previously configured repository address)

Fifth step: Git push-u Origin master--push to master Branch

3. After the code has been uploaded successfully,

Iv. encountering problems and solutions Note: For the first time, the following questions will be encountered during the input of the above instruction:

1. If the cmd window sees a prompt for these two messages

$ git config--global user.name "John Doe"
$ git config--global user.email [email protected]

Workaround: Press the above elevation, cmd window and then enter

>git config--global user.name "Here is your GitHub user name"

>git config--global user.email [email protected] (your email)

2. When submitting to remote, prompt:

Fatal:remote origin already exists.

WORKAROUND: Delete the remote git repository

>git Remote RM origin

3. When you need to log in during the first operation, enter your account name and password as prompted

Local code uploaded 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.