Git and Github first use basic tutorials

  
 

Steps to use GitHub: 1. Apply for GitHub account xxx, create a new Repository named new-project

2, install 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 "[email protected]"4, copy .ssh/id_rsa.pub to GitHub website

5, for convenience, set ssh without entering password # eval `ssh-agent`# ssh-add (enter passphrase)

6, test whether it can connect to GitHub#ssh [email protected] if the configuration is correct, Show ERROR: Hi xxx! You've successfully authenticated, but GitHub does not provide shell accessConnection to github.com closed.

7. Set Git global user configuration# git config --global user.name "xxx" ;# git config --global user.email [email protected]

8. Create a local new project work tree # mkdir new-project# cd new-project# git init# touch README# git add README# Git commit -m 'first commit' defines the remote server alias origin# git remote add origin [email protected]:xxx/new-project.git local and far Merge, the local default branch is master# git push origin master

GitHub can be seen on the website, http://github.com/xxx/new-project

9. Update file# Vi README automatic commit change file # git commit -a update to remote # git push origin master

Copyright © Windows knowledge All Rights Reserved