It is a distributed code management tool. Remote code management is based on SSH, so SSH configuration is required to use remote git.
The SSH configuration for GitHub is as follows:
I,
Set git user name and email:
$ git config --global user.name "xuhaiyan"
$ git config --global user.email "haiyan.xu.vip@gmail.com"
Ii. SSH key generation process:
1. Check whether an SSH key is available: Cd ~ /. SSH
If no key exists, this folder is not available. If yes, the backup is deleted.
2. Survival key:
$ Ssh-keygen-t rsa-C haiyan.xu.vip@gmail.com"
Press 3 and press Enter. The password is blank.
Your identification has been saved in/home/tekkub/. Ssh/id_rsa.
Your public key has been saved in/home/tekkub/. Ssh/id_rsa.pub.
The key fingerprint is:
..................
Finally, two files are obtained: id_rsa and id_rsa.pub.
3. Add the key to SSH: SSH-add file name
Enter the password.
4. Add an SSH key on GitHub. This is the public key in "id_rsa.pub.
Open https://github.com/, log on to xuhaiyan825, and then add ssh.
5. Test: SSH git@github.com
The authenticity of host 'github. com (207.97.227.239) 'can't be established.
RSA key fingerprint is 16: 27: AC: A5: 76: 28: 2D: 36: 63: 1b: 56: 4d: EB: DF: A6: 48.
Are you sure you want to continue connecting (Yes/No )? Yes
Warning: Permanently added 'github. com, 207.97.227.239 '(RSA) to the list of known hosts.
Error: Hi tekkub! You 've successfully authenticated, but GitHub does not provide shell access
Connection to github.com closed.
3. Start Using GitHub
1. Obtain the source code:
$ git clone git@github.com:billyanyteen/github-services.git
2. There will be a repo on your machine.
3. Git is different from Svn in that git is distributed and has no server concept. All human machines have a repo, and each commit is a repo for their own machines.
Repository initialization:
git init
Generate a snapshot and store it to the project index:
git add
Files, git RM, git mV, etc...
Project index submission:
git commit
4. collaborative programming:
Merge the local repo with the remote origin repo,
Push local updates to remote:
git push origin master
Update a remote update to a local device:
git pull origin master
Supplement:
Add remote repo:
$ git remote add upstream git://github.com/pjhyett/github-services.git
Rename remote repo:
$ Git: // github.com/pjhyett/github-services.gitfor “upstream"