Git ABC

This article describes how to use Git to manage your project.

1. Download and install the latest version of Git for Windows. http://code.google.com/p/msysgit/downloads/list

Install Git with default settings (you can change the install path if you like)

2. Set Up SSH Keys
[a] Open Git Bash and check for SSH key by using command: $ cd ~/.ssh, if it shows "no such file or folder" then go to step [c], or else go to step [b]
[b] Backup and remove existing SSH keys by using below commands:
$ ls
config id_rsa id_rsa.pub known_hosts (this is just an example...)
$ mkdir key_backup
$ cp id_rsa* key_backup
$ rm id_rsa*

[c] Generate a new SSH key.
$ ssh-keygen -t rsa -C "[email protected]" (no passwords are required, just press "Enter" key)

[d] Add your SSH key to GitHub. On the GitHub site Click “Account Settings” > Click “SSH Keys” > Click “Add SSH key”, Open the id_rsa.pub file with a text editor (Notepad, TextEdit, or gedit will do just fine). This is your public SSH key. You may need to turn on “view hidden files” to find it because the .ssh directory is hidden.
[e] Test everything out. Enter command: $ ssh -T [email protected], and you will find "git.com" has been added into "know_hosts" file which under .ssh folder.

3.Set Up Your Info
$ git config --global user.name "Firstname Lastname"
$ git config --global user.email "[email protected]"

4. Test
$ git remote add origin "[email protected]"
$ git pull origin master

Reference: http://help.github.com/win-set-up-git/
https://help.github.com/articles/generating-ssh-keys

猜你喜欢

转载自vrplat.iteye.com/blog/1512283
ABC
今日推荐