After downloading git in the GitHub site, run the git Shell (command-line window), we need several steps to complete a project release to the GitHub site
# # #git信息设置
1: Set account information: Git config--global user.name "own account"
2: Set mailbox information: Git config--global user.email "home Email"
View configuration list: Git config--list
# # #ssh配置 (local warehouse and service-side warehouse communication credentials)
3:ssh-keygen-t rsa-c "own email"//execution will let the input file name, secret, etc., all enter ignored, generated into the ~\.SSH directory (that is: C:\Users\Administrator\.ssh, you can type in the command Window CD ~\ . SSH and view files and contents)
4:ssh-add ~/.ssh/id_rsa//Add encryption key to warehouse
5:SSH-T [email protected] //test Connection Status
# # #仓库的建立
6: Create a server-side warehouse at the GitHub site (web interface Operations)
7: Create a local repository locally (2 ways):
One: Clone git clone from remote repository [email protected]: account ID/ project name . git
II: Establish a local warehouse and associate a remote warehouse
Build a warehouse locally:
mkdir project name
     CD Project name
git Init
Associate a remote repository (that is, set up a remote branch):
git remote add olt git://github.com/account ID/ project name . Git//olt is the alias for the link, and method one establishes an alias of origin
At this point, the warehouse has been established, as follows to give the warehouse synchronization data related commands
# # #数据同步操作
1: Update remote files to local
git fetch OLT master//update content will be cached locally and the merge command needs to be executed to merge with local content
Git pull Olt master//Direct merge
2: Merging
git merge Olt/master
3: View
git status
4: Add a local warehouse
git add--all <path>/
git add--ignore-removal <path>
5: Submit to local repository
git commit-m "msg"
6: Submit to remote repository
git push-u olt Master
7: Rename the remote branch:
View branching git remote-v
GIT remote RM olt//Rebuilt repository need to re-execute the command and then re-remote add
git remote add Olt[email protected]:Account ID/Project Name. git
Simple use of GitHub and Git