Steps for using GitHub:
1. Apply for a GitHub account XXX and create a new repository named new-project.
2. Install the GIT client (Linux)
# Yum install git Git-Gui
3. Generate a key pair so that the project can be pushed to GitHub.
# Ssh-keygen-t rsa-c "xxx@gmail.com"
4. Copy. Ssh/id_rsa.pub to the GitHub website.
5. For convenience, set SSH without entering a password
# Eval 'ssh-agent'
# Ssh-add
(Input passphrase)
6. Test whether GitHub can be connected
# SSH git@github.com
If the configuration is correct
Error: Hi XXX! You 've successfully authenticated, but GitHub does not provide shell access
Connection to github.com closed.
7. Set git global user configuration
# Git config -- global user. Name "XXX"
# Git config -- global user. Email xxx@gmail.com
8. Create a new local project work tree
# Mkdir New-Project
# Cd New-Project
# Git init
# Touch readme
# Git add readme
# Git commit-m'first commit'
Define Remote Server alias Origin
# Git remote add origin git@github.com: xxx/new-project.git
Local and remote merge. The local default branch is master.
# Git push origin master
GitHub site can see, http://github.com/xxx/new-project
9. Update files
# Vi readme
Automatic commit to change files
# Git commit-
Update to remote
# Git push origin master