`
huhu_long
  • 浏览: 69086 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Git ABC

git 
阅读更多
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 "your_email@youremail.com" (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 git@github.com, 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 "your_email@youremail.com"

4. Test
$ git remote add origin "git@aaa.com"
$ git pull origin master

Reference: http://help.github.com/win-set-up-git/
https://help.github.com/articles/generating-ssh-keys
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics