Uploading items to GitHub

Source: Internet
Author: User

Uploading local items to GitHub

I was recently working on a project with a small, horse -named Little Tramp, because I was apart with him and thought about using GitHub.

This article records the issues encountered during the uploading of the project, although it is a small problem, but it is necessary to record a bit.

First, create a GitHub account, not described here

Second, create a warehouse, get the address of the warehouse, for example: [email protected]: User name/warehouse name. Git

  

third , create a good warehouse, you can put things inside, first, we need to download a local git, the installation process is no longer described here

The GIT configuration and the GitHub SSH key configuration are as follows:

' Your name '  'your email'  ssh-keygen -t RSA

return all the way to generate the public key

Copy the generated public key to GitHub user settings

Use cat ~/.ssh/id_rsa.pub to view, copy public key content

Web login github, click on Avatar--->settings--->ssh and GPC keys--->new SSH key, name it, then copy the public key in

You can then test whether the connection was successful

Ssh

Something appears to indicate success

  

Enter the local project directory, right mouse button---> Git Bash here, go to command line interface input command

" Commit Test " git remote add origin [email protected]: User name /repository name. Git

If you now attempt to use Git push-u origin master to upload the current branch code to the Master branch, you will get an error, such as

  

The main reason for the error is that the readme.md file in GitHub is not in the local code directory

You can merge code with the following commands (note: pull=fetch+merge)

Git pull--rebase Origin master

This is what you will find in your folder there is a readme.md file, then upload

Git push-u Origin Master

Done!

  Note : Files larger than 4M, then you will not succeed, will error

FATAL:SHA1 file ' <stdout> ' write Error:broken pipeib/s

You can use the command to increase the limit

52428800

When you're done, you can log in to GitHub to view the items you've uploaded.

END.

Uploading items 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.