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