git使用安装实战

安装环境:Windows 

 

安装msysgit

进入到http://code.google.com/p/msysgit/

下载Git-1.7.60preview20110708.exe版本

 

按默认安装

 

安装TotoiseGit

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

下载 最新版本,并安装

 

设置个人信息

开始--所有程序--TotoiseGet--Setting

Git--config

填写UserInfoNameEmail

 

基本的TotoiseGit使用和TotoiseSVN一样

建议试试下载

git://github.com/antirez/redis.git

这个代码来试试

 

git使用安装实战

 

 

创建GitHub账号:

https://github.com/

GitHub可以托管各种git库,并提供一个web界面,功能和google-code差不多

 

以下步骤参考http://help.github.com/win-set-up-git/

 

创建SSH Key,并增加SSH Key

 

创建:

ssh-****** -t rsa -C "[email protected]"

按照提示一步步走,直到提示:

Your public key has been saved in /c/….

 

增加ssh key

On the GitHub site Click “Account Settings” > Click “SSH Public Keys” > Click “Add another public key”

 

key这个字段中填写

id_rsa.pub文件中的内容

id_rsa.pub目录是在刚刚存放的.ssh目录(这是个隐藏目录)中

 

测试是否已经安装完成了

ssh -T [email protected] to ssh to github

 

7建立个人信息

git使用安装实战

其中的usertoken是你在github上的用户名和token

 

创建Repo

进入:https://github.com/repositories/new

填写需要填写的字段

 

提交后进入新页面

按照提示创建一个测试gitrepro

mkdir testgithub

  cd testgithub

  git init

  touch README

  git add README

  git commit -m 'first commit'           //git提交

  git remote add origin [email protected]:jianfengye/testgithub.git   //github上增加一个Repo

  git push -u origin master    //将文件上传
 

创建一个项目的分支

Spoon-Knife为例子

git clone [email protected]:username/Spoon-Knife.git   //复制这个项目

$ cd Spoon-Knife

$ git remote add upstream git://github.com/octocat/Spoon-Knife.git  //加入分支upstream

$ git fetch upstream  //获取分支upstream

$ git push origin master  //上传本地文件

 

-------------------------

参考地址:

http://help.github.com/

http://baike.baidu.com/view/3366456.html?fromTaglist

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

http://wenku.baidu.com/view/730e56896529647d2728520d.html?from=related&hasrec=1