Windows 下使用 Github 第一步
2011-07-06 23:16
232 查看
进入 github.com 网站注册个账号 点 Pricing and Signup 申请,很容易申请到,不需要邮箱验证
登录账号 在仪表盘页面 找到
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
登录账号 在仪表盘页面 找到
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
相关文章推荐
- 教你怎么使用Github for Windows?
- Github for Windows使用介绍
- GitHub的安装和使用(Windows、Linux系统上)
- Windows下AndroidStudio 中使用Git(AndroidStudio项目于GitHub关联)
- github for Windows使用介绍
- Github for Windows 1.0 版本的简单使用介绍
- Github for Windows使用图文教程
- [转]windows下使用git管理github项目
- GitHub for Windows 2.0使用教程
- windows中使用Git工具连接GitHub(配置篇)
- 使用GitHub For Windows托管Visual Studio项目
- 在Windows使用git工具将代码同步至github(作者:ying1989920)
- 【Git/Github学习笔记】ubuntu系统下使用git命令与windows下的差别
- github 和 github for windows 学习使用总结
- windows中使用Git工具连接GitHub(配置篇)
- 64位windows 7下成功配置TortoiseGit使用Github服务器
- 在windows下使用TortoiseGit提交代码到github
- windows中使用Git工具连接GitHub(配置篇)
- 初识GihHub,创建仓库,使用GitHub for Windows 同步本地代码文件,创建分支
- Github for Windows使用图文教程