Windows 下使用 Github 第一步

进入 github.com 网站注册个账号 点 Pricing and Signup 申请,很容易申请到,不需要邮箱验证

登录账号 在仪表盘页面 找到 

Set Up Git  这个对GIT的设置步骤非常详细,按着一步一步做

首先下载 Git for Windows.

http://code.google.com/p/msysgit/downloads/list


安装 一路NEXT 安装完成。

到开始菜单中找到 Git Bash 点击,跟DOS 页面一样,不过是linux下 shell的语法,

如下是我的

Welcome to Git (version 1.7.4-preview20110204)


Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.

Lishiguang@XP-201106151358 ~

1、检查一下是否生成过SSH Key


$ cd ~/.ssh 

Lishiguang@XP-201106151358 ~/.ssh 

2、发现已经存在一个KEY

$ ls
id_rsa  id_rsa.pub


3、将此SSHkey备份
Lishiguang@XP-201106151358 ~/.ssh
$ mkdir kye_backup
$ cp id_rsa* key_backup
cp: copying multiple files, but last argument `key_backup' is not a directory
Try `cp --help' for more information.
$ rm id_rsa*

4、KEY 已经备份好 并移除
Lishiguang@XP-201106151358 ~/.ssh
$ ls
kye_backup

5、生成自己新的KEY 后面是自己的邮箱地址 前面 固定格式 
$ ssh-keygen -t rsa -C "alishiguang@gmail.com"

Generating public/private rsa key pair.

5.1 第一个回车 会将新KEY 生成到 下面的目录中

Enter file in which to save the key (/c/Documents and Settings/Administrator/.ss

h/id_rsa):

5.2  输入密码 并确认一次 生成新的KEY

Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Documents and Settings/Administrator/.s
sh/id_rsa.
Your public key has been saved in /c/Documents and Settings/Administrator/.ssh/i
d_rsa.pub.
The key fingerprint is:
f3:c6:59:64:a4:b8:71:4e:49:57:1a:94:c9:65:d4:20 alishiguang@gmail.com

6 测试一下
Lishiguang@XP-201106151358 ~/.ssh
$ ssh -T 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 know
n hosts.
Enter passphrase for key '/c/Documents and Settings/Administrator/.ssh/id_rsa':


Permission denied (publickey).

添加您的SSH密钥,以GitHub上。

在GitHub的网站点击“帐户设置” > 点击“SSH公钥” > 点击“添加其他公共密钥”


Lishiguang@XP-201106151358 ~/.ssh
$ git config --global user.name "alishiguang"


Lishiguang@XP-201106151358 ~/.ssh
$ git config --global user.email "alishiguang@gmail.com"


Lishiguang@XP-201106151358 ~/.ssh
$ git config --global github.user lishiguang


Lishiguang@XP-201106151358 ~/.ssh
$ git config --global github.token 88b35c88af0fd459550bb0f7c6c70b74



第一次更新一个文件 并上传

Lishiguang@XP-201106151358 ~/.ssh
$ mkdir ~/NoDB


Lishiguang@XP-201106151358 ~/.ssh
$ cd ~/NoDB


Lishiguang@XP-201106151358 ~/NoDB
$ git init
Initialized empty Git repository in c:/Documents and Settings/Administrator/NoDB
/.git/


Lishiguang@XP-201106151358 ~/NoDB (master)
$ touch README


Lishiguang@XP-201106151358 ~/NoDB (master)
$ git add README


Lishiguang@XP-201106151358 ~/NoDB (master)
$ git commit -m 'frist commit'
[master (root-commit) 9c4650c] frist commit
 1 files changed, 8 insertions(+), 0 deletions(-)
 create mode 100644 README


Lishiguang@XP-201106151358 ~/NoDB (master)
$ README
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值