teach you how to upload files on GitHub

Source: Internet
Author: User

(1) Register your github account and install local git

Sign Up will let you choose your code hosting is private and public, private is paid, only individuals can see;

(2) Create a new warehouse on GitHub, fill in the description of your warehouse name (TEST2) and warehouse, and initialize the repository and a readme (after initialization, follow the instructions to update the latest repository)

(3) Create a local folder where the code is stored

(4) Open git brash, pwd command to view the current directory

   CD D:CD gitworkspaces CD Test2 jump to the same directory as the local repository

Execute the GIT init command (turn this directory into a directory that git can manage)

You will see one more. git file under the current directory

(5) Create an SSH key locally (that is, the public key)

$ ssh-keygen-t rsa-c "[email protected]" all the way to the carriage return, and finally the. ssh file is generated under the directory.

Password for the public key, create a new public key on GitHub and paste the password up.

(6) Upload the local repository to GitHub

git remote Add the repository's HTTPS above the Origin +github, which can then be viewed via git remote (for ease of administration, GIT requires that each remote host must specify a host name.) git remote   command is used to manage host names. )

(7) Optional steps (in step 2 if you initialize the repository and a readme, you need to follow the new local repository before uploading)

by using the Git Pull--rebase Origin master command to update, you will find that your Test2 directory has one more file (the function of the git pull command is to retrieve the update from a branch of the remote host, and then the local Consolidated)

(8) Create a new file in the local directory and then

git add re.txt (add)

Git commit-m "Sencond" to create a new (commit) in Git

At last

Git push-u origin master uploads to GitHub, and you'll see that GitHub has the same content as your Test2 folder! (Used to push updates to the local branch to the remote host)

Finally, take a look at the command line I knocked. !

teach you how to upload files on 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.