basic Condition: Installation GitHub, after the installation is successful; (Windows System)
1, after the installation is complete, also need a step setting, in the command line input:
$ git config--global user.name "Your name"
$ git config--global user.email "[email protected]"
2. configuring The Ssh public key
a) Check if this machine has Ssh key settings: $ CD ~/.SSH  or cd .ssh (if not, prompt: no such file or directory ~/.ssh Path ( ls View current path file, RM *  delete all files)
b) Generate key: $ ssh-keygen-t rsa-c "[email protected]" got two files:Id_rsa and Id_rsa.pub.
c) Add the ssh key on GitHub , which is to addthe public key in "id_rsa.pub".
d) Open GitHuband find setting->ssh Choose Add an SSH,title Write (preferably known) and Copy the contents of the id_rsa.pub to the box in the title .
(You only need to use it for the first time)
3. Create a version library
find the right place to create an empty directory (right-click -Git Bash) and enter the command:
mkdir learngit(file name)
CD Learngit
PWD (pwd command is used to display the current directory, can not be written)
4. use git init command to become a repository managed by git
Git init
At this Git has built the warehouse and told you it's an empty repository (emptygit repository)
5. Add files to the warehouse
Copy the file you want to upload into the folder Learngit , and then execute the command
git Add. ( . represents all files in the Add folder)
No display after execution, indicating correct.
6. Use the command git commit to tell gittosubmit the file to the repository
Git commit-m "First commit"
(can be written in quotation marks, where the content is a description, such as this is the first time to submit)
7. Create a remote repository
Login GitHub, find the "newRepository" button in the top right corner, create a new warehouse, fill in the name (learngit), and click Create.
8. according to GitHub tips, run the command under the local learngit Warehouse:
Git remote add Origin [email protected]: Flower-qh/learngit.git
(flower-qh is your own GitHub account name)
9. Push all the contents of the local library to the remote library and execute the command:
Git push-u Origin Master
10, (the second way) from the remote library cloning
First, login GitHub, create a new warehouse, named xxx
We tick Initialize this repository with a README, so GitHub will automatically create a readme.md file for us. Once created, you can see the readme.md file
Then, clone a local library with the command git clone
git clone [email protected]: Michaelliao/xxx.git
Finally, execute the 5,6,11.
GitHub uploads Local Files