Windows中使用Git笔记

首先安装Git的Window版本。 Git for Windows http://code.google.com/p/msysgit/

使用Git之前先用Git Bash生成SSH Key ssh-keygen -t rsa -C "[email protected]",进入.ssh文件夹所在的目录(Win7下是C:\Users\<User Name>\.ssh),将public key用文本编辑器打开,拷贝出文本上传给服务器。 参考:http://help.github.com/win-set-up-git/

*passphrase的作用是保护你储存在磁盘上的密钥,一般情况下可以不用passphrase

之后,还需要配置Git中你的用户名和Emai地址,这些信息会显示在你Commit的Comment中。

git config --global user.name "Firstname Lastname"

git config --global user.email "[email protected]"

这一步也可以在安装好tortoisegit后使用UI界面配置。 tortoisegit  http://code.google.com/p/tortoisegit/

tortoisegit会使用系统中安装好的Git for Windows。

扫描二维码关注公众号,回复: 1144889 查看本文章

右键菜单或者开始菜单中进入Settings配置上述信息。

进一步使用tortoisegit需要将之前生成的公钥私钥中的私钥转换成putty能够使用的私钥。

开始菜单运行puttygen,点击Load,进入.ssh文件夹所在的目录,选择All Files*.*,选中之前生成的那个private key,生成新的putty私钥保存。

这样之后,当使用tortoisegit要用私钥时,就可以使用这个转换过的私钥。

Eclipse 3.7已经自带Egit,个人觉得目前还不是很成熟。版本控制系统的客户端未必需要与IDE紧密结合。无论在哪个平台下,目前Git最佳使用的方式是命令行。

重要学习资料:

Pro Git http://progit.org/

Git Referencehttp://gitref.org/

Git官网http://git-scm.com/

猜你喜欢

转载自leonlu.iteye.com/blog/1111586