How to upload your local code to GitHub

Source: Internet
Author: User
Tags git clone git shell

First step: Create a new GitHub account

Step Two: Create a new warehouse

650) this.width=650; "src=" Http://lazynight.me/wp-content/uploads/2013/05/newgithub.png "alt=" Newgithub "style=" margin:0px;padding:0px;border:0px, "height=" width= "225"/>

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.

650) this.width=650; "class=" Alignnone size-full wp-image-2899 "src=" http://lazynight.me/wp-content/uploads/2013/05 /createdemo.png "alt=" Createdemo "style=" margin:0px;padding:0px;border:0px; "height=" 484 "width=" 687 "/>

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.

650) this.width=650; "class=" Alignnone size-full wp-image-2904 "src=" http://lazynight.me/wp-content/uploads/2013/05 /ssh3.gif "alt=" Ssh3 "style=" margin:0px;padding:0px;border:0px; "height=" 174 "width=" 193 "/>

Copy all the contents of the Id_rsa.pub file under the folder.

Then open the GitHub account settings,

650) this.width=650; "class=" Alignnone size-full wp-image-2901 "src=" http://lazynight.me/wp-content/uploads/2013/05 /setting.png "alt=" setting "style=" margin:0px;padding:0px;border:0px; "height=" "width=" 231 "/>"

Open SSH keys

650) this.width=650; "class=" Alignnone size-full wp-image-2902 "src=" http://lazynight.me/wp-content/uploads/2013/ 05/ssh.png "alt=" ssh "style=" margin:0px;padding:0px;border:0px; "height=" 179 "width=" 265 "/>
upper right corner click Add SSH key

650) this.width=650; "class=" Alignnone size-full wp-image-2903 "src=" http://lazynight.me/wp-content/uploads/2013/05 /ssh2.png "alt=" Ssh2 "style=" margin:0px;padding:0px;border:0px "height=" width= "664"/>

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:

650) this.width=650; "src=" http://lazynight.me/wp-content/uploads/2013/05/link.png "alt=" link "style=" margin:0px; padding:0px;border:0px, "height=" width= "608"/>

git clone https://github.com/Flowerowl/stumansys.git

This will be generated under the directory:

650) this.width=650; "class=" Alignnone size-full wp-image-2906 "src=" http://lazynight.me/wp-content/uploads/2013/05 /desk.png "alt=" desk "style=" margin:0px;padding:0px;border:0px;width:690px; "height=" 242 "width=" 861 "/>

Eighth step: Copy the code directory you want to upload to this folder:

650) this.width=650; "class=" Alignnone size-full wp-image-2907 "src=" http://lazynight.me/wp-content/uploads/2013/05 /code.png "alt=" code "style=" margin:0px;padding:0px;border:0px; "height=" 166 "width=" 314 "/>

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.

650) this.width=650; "class=" Alignnone size-full wp-image-2908 "src=" http://lazynight.me/wp-content/uploads/2013/05 /cmd.png "alt=" cmd "style=" margin:0px;padding:0px;border:0px;width:690px; "height=" 179 "width=" 794 "/>

Finally, you can go to the project page to see ~ ~ Code Upload Success!


How to upload your local code 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.