- 帖子
- 474
- 积分
- 4281
- 金钱
- 444
- 在线时间
- 640 小时
- 注册时间
- 2010-10-13
- 最后登录
- 2015-8-24
|
这个网站搞得我很蛋疼
安装Git on Windows
无视Windows……
3. 配置
3.1 检查是否已经存在KEY
1 $ cd ~/.ssh
2 $ ls
3 config id_rsa id_rsa.pub known_hosts
4 $ mkdir key_backup
5 $ cp id_rsa* key_backup
6 $ rm id_rsa*
如果已经存在KEY(id_rsa, id_rsa.pub),把他们拷贝到key_backup目录备份, 因为SSH默认会使用”.ssh”目录下的KEY
3.2 生成SSH KEY
view source print?
1 $ ssh-keygen -t rsa -C "your_mail_addr@gmail.com"
2 Enter file in which to save the key (/home/sylvester/.ssh/id_rsa):
3 Enter passphrase (empty for no passphrase):
4 Enter same passphrase again:
5 Your identification has been saved in /home/sylvester/.ssh/id_rsa.
6 Your public key has been saved in /home/sylvester/.ssh/id_rsa.pub.
7 The key fingerprint is:
8 e8:ae:60:8f:38:c2:98:1d:6d:84:60:8c:9e:dd:47:81 your_mail_addr@gmail.com
在这里会要求输入key 目录和 密码,可根据自己的情况输入
3.3 将Public Key 添加到GitHub
打开你的GitHub->SSH Public Key->点击“Add another public key”, 将你的public key(id_rsa.pub)的内容拷贝到GitHub中
3.4 测试
view source print?
1 $ ssh git@github.com
2 ERROR: Hi sylvester! You've successfully authenticated, but GitHub does not provide
3 shell access
4 Connection to github.com closed.
5 成功!!
4. 下载你的项目
view source print?
1 $git clone git://github.com/sylvester/meelisp.git
5. 提交变更
5.1 配置
view source print?
1 git config --global user.name "Your Name"
2 git config --global user.email your_email@gmail.com
5.2 创建Repository
view source print?
1 mkdir meelisp
2 cd meelisp
3 git init
4 touch README
5 git add README
6 git commit -m 'first commit'
7 git remote add origin git@github.com:your_name/meelisp.git
8 git push origin master
5.3 提交已经存在的Repository
view source print?
1 cd existing_git_repo
2 git remote add origin git@github.com:your_name/meelisp.git
3 git push origin master |
|