Git is a distributed Code management tool, remote code management is SSH-based, so to use the remote git requires SSH configuration.
The SSH configuration for GitHub is as follows:
One
Set the user name and email for git:
$ git config--global user.name "Xuhaiyan"
$ git config--global user.email "[Email protected]"
1. See if you already have an SSH key: cd ~/.ssh
If you don't have a key, you won't have this file. Clip, there is a backup delete
2. Survival key:
[Email protected] "
Press 3 to enter, the password is empty.
Finally, two files were obtained: Id_rsa and Id_rsa.pub
3. Add the encryption key to the Ssh:ssh-add file name
Enter the password before you need it.
4. Add the SSH key on GitHub, which adds the public key in "Id_rsa.pub".
Open https://github.com/ , log in to xuhaiyan825, and then add SSH.
5. Test: SSH [email protected]
Third, start using GitHub
1. Get the source code:
$ git clone [email protected]:billyanyteen/github-services.git
2. So there's a repo on your machine.
3.git different from SVN is that git is distributed and there is no server concept. All the people have a repo on the machine, each submission is to their own machine repo
Warehouse initialization:
Git init
Generate a snapshot and deposit the project index:
git add
Files, git rm,git mv, etc...
Project Index submission:
Git commit
4. Collaborative programming:
Merge the local repo with repo from the remote origin,
Push local update to remote:
Git push Origin Master
Update remote updates to Local:
Git pull Origin Master
Add:
To add a remote repo:
$ git remote add upstream git://github.com/pjhyett/github-services.git
To rename a remote repo:
$ git://github.com/pjhyett/github-services.git to "upstream"
GitHub's SSH configuration is as follows