Use git to upload local items to GitHub and update

Source: Internet
Author: User

Recently in the play GitHub this base friend platform, here to do a summary, easy to consult later, you can also give users a reference.

One: Register your github account and download git.

Second: Create a new warehouse on GitHub, point + and click New Repository, give your warehouse a name, mine is test.

    

  

    

Three: Install git, I install the Win64 version, directly decompression installation is good. Find a folder on your local disk as your local repository, choose git Bash here, switch to the/e/te directory, enter git init initialization, and find a more. git folder in the directory.

      

     

     

Quad: Configure SSH key value

git config--global user.name "username", git config--global user.email "email address" in git command line.

        

On the git command line, enter the command: CD ~/.ssh, to detect if a key has been generated, there is no key generated, there will be relevant information prompts, and then enter the command: ssh-keygen-t rsa-c "email Address", press ENTER, and then according to the information returned, Find the two files in the. SSH directory;

        

On GitHub Click "Setting", find the Add SSH key menu, and then added SSH key, the file id_rsa.pub inside the contents of all copied to the key edit box, title can be arbitrarily named, Save finished;

        

         

In the git command line input: ssh-t [email protected], here will ask you to enter the SSH key password, if you just generated SSH key did not enter the password, the password is empty; and then see the message:

Error:hi User name! You've successfully authenticated,but GitHub does not provide shell access.; Description configuration succeeded;

Login to GitHub to view the SSH key just entered, now the color of the icon turns green, the key configuration is valid; Now you can do git on the git command line;

        

Five: Upload local project to warehouse

(1) Remote repository $ git Remote add origin [email Protected]:yourname/yourrepo.gitwison. Yourname is your username, Yourrepo.gitwison is the warehouse where you want to upload the project.

          

(2) Add the file you want to upload, git Add. On behalf of all files in the upload directory, you can add the files that you want added after git add, such as git add aa.html

          

(3) Submit project, enter Git commit-a-M "Wison" Wison is tagged who uploads. Then enter GIT push Origin master, you're done, you can view the project on GitHub

           

           

Six: Update the project, first add files, then submit, update before the best Git pull Origin Master Update your local project, because there may be someone else did the update

              

         

Use git to upload local items to GitHub and update

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.