GitHub upload File

Source: Internet
Author: User
Tags git clone

Previously used GitHub to manage their own code, but has been unable to remember the statement, today again use GitHub, or record it.

1. Upload your own code for the first time

Create your own library on the GitHub and execute it in the directory of your code:

Git init
Touch readme.md
git add readme.md

When git commit-m ' first_commit ' executes this sentence, sometimes it goes wrong.

When this error occurs, follow the prompts: git config--global user.email "you@example.com" Your git account's mailbox
git config--global user.name "Your name" the username of your git account

Git remote add Origin https://github.com/nicky-ji/Turbo.git
Git push Origin Master

2. Update your own code base

This is the method used to update the code base

git Add. (Note that there is a dot below.)
Git commit-m ' first_commit '
Git remote add Origin https://github.com/nicky-ji/Turbo.git

Execution may occur when the following appears, execute the statement git remote RM origin


Git push origin master enter username and password OK.


Ps:

In fact, when I first contacted GitHub, I didn't succeed with the first method above. Instead of cloning the empty code base,

Execute git clone https://github.com/nicky-ji/Turbo.git and execute the 2 statement first. Hey, also a way to wow


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.