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