Uploading local files to GitHub

Source: Internet
Author: User
Tags knowledge base

Recently , referring to the idea of a public class to do an operational automation monitoring system, want to upload the code to our Information center on this side of the teacher built a GitHub , in order to learn to communicate. In the process of uploading encountered a pit, the detailed process is described below for further reference (GitHub Address:https://202.207.177.110). My local environment is Centos6.3

1. First build a project on GitHub, which is easy and doesn't repeat

2. Global Environment settings locally (the user name and mailbox are the user name and mailbox I used when I registered)

# git config--global user.name "Fsy"

# git config--global user.email "[email protected]"

3. generate a pair of keys locally and place the public key in the public key location of GitHub's settings ( This is important, because I did not do this step, resulting in unable to upload )

# ssh-keygen-t Rsa-c "[email protected]"

4. to create a new knowledge base

# git clone [email protected]: Fsy/test.git (this path is from the path where the project was created above)

5. Add the project's file to the warehouse (provided that you have placed the file you want to upload in the test directory)

# CD Test

# git Add.

6. commit The file you want to add to the repository

# git commit-m " name " (note that each upload must have a name, this can be defined by itself)

7. upload code to a remote GitHub repository

# Git push-u Origin Master

At this point, upload completed

Add: If it's a directory that already exists, add something to it

# CD Test

# git Init

# git remote add origin [email protected]:fsy/test.git

# git Add.

# git commit-m " name "

# Git push-u Origin Master

                                                                                    

Welcome to criticize and correct!

This article is from the "10917734" blog, please be sure to keep this source http://10927734.blog.51cto.com/10917734/1941186

Uploading local files 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.