Recently, you need to upload your lesson code to GitHub, just to fork someone else's code.
This article is written using the method under Windows.
First step: Create a new GitHub account
Step Two: Create a new warehouse
Part III: Fill in the name, Introduction (optional), tick initialize this repository with a readme option, which is automatically created Reamde.md file, save you to create again.
Fourth step: Install GitHub Shell program, address: http://windows.github.com/
Fifth step: Open the Git Shell and enter the following command to generate the key to verify the identity
Ssh-keygen-c ' [email protected] '-t RSA
After three consecutive returns, the. SSH folder is generated under the Windows current User directory, just like Linux.
Copy all the contents of the Id_rsa.pub file under the folder.
Then open the GitHub account settings,
Open SSH keys
upper right corner click on Add SSH key
Then in the title casually input, key bar paste just the key.
Sixth step: Enter the command under GIT shell to test if the public key is properly authenticated.
ssh-t [email protected]
The correct results are displayed:
warning:permanently added ' github.com,207.97.227.239 ' (RSA) to the list of known hosts. Hi flowerowl! You've successfully authenticated, but GitHub does not provide shell access.
Warning don't bother.
Seventh Step: Clone the newly created repository to local, enter the command:
git clone https://github.com/Flowerowl/stumansys.git
This will be generated under the directory:
Eighth step: Copy the code directory you want to upload to this folder:
Nineth Step: Switch to the git shell command line and enter the command:
git initgit commit-m ' stumansys ' git remote Add Origin Https://github.com/Flowerowl/stumansys.gitgit push Origin master
If you execute git remote add origin
Https://github.com/Flowerowl/stumansys.git
, an error occurred:
Fatal:remote origin already exists
The following statement is executed:
Git remote RM origin
Then execute git remote add origin https://github.com/Flowerowl/stumansys.git .
When executing GIT push Origin master, an error occurred:
error:failed to-push som refs to ....
The following statement is executed:
Git pull Origin Master
First, the remote server github above the file pulled first, and then push up.
Finally, you can go to the project page to see ~ ~ Code Upload Success!
There are questions can be in the bottom of the message, we solve together ~
Reprint Please specify: Kat in? GitHub Upload Code rookie Super Detailed tutorial
GitHub Upload Code Rookie Super Detailed tutorial "Go"