[普通]git for windows+TortoiseGit客户端的使用

作者(passion) 阅读(1194次) 评论(0) 分类( 随笔)

一、安装Git客户端

            全部安装均采用默认!

           1. 安装支撑软件 : https://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git     

各项全选:

选第三项使用unix命令:run git and included unix tools from windows command prompt

选第一项:检出CRLF->LF, 检入LF->CRLF

安装git for windows好,可使用C:\Program Files (x86)\Git\bin目录下命令工具:

antiword.exe
astextplain
awk
basename.exe
bash.exe
bison.exe
bunzip2
bzip2.exe
c_rehash
cat.exe
chmod.exe
clear
cmp.exe
connect.exe
cp.exe
curl-ca-bundle.crt
curl.exe
cut.exe
date.exe
diff.exe
dirname.exe
docx2txt
dos2unix.exe
du.exe
echo
egrep
env.exe
expr.exe
false.exe
find.exe
flex.exe
gawk.exe
getcp.exe
git.exe
gitk
gpg-zip
gpg.exe
gpgkeys_curl.exe
gpgkeys_finger.exe
gpgkeys_hkp.exe
gpgkeys_ldap.exe
gpgsplit.exe
gpgv.exe
grep.exe
gunzip.exe
gzip.exe
hd2u.exe
head.exe
iconv.exe
id.exe
kill.exe
less.exe
libW11.dll
libapr-0-0.dll
libaprutil-0-0.dll
libcrypto.dll
libcurl.dll
libexpat-0.dll
libgsasl-7.def
libgsasl-7.dll
libiconv-2.dll
libintl-8.dll
libneon-25.dll
libpoppler-7.dll
libssl.dll
libsvn_client-1-0.dll
libsvn_delta-1-0.dll
libsvn_diff-1-0.dll
libsvn_fs-1-0.dll
libsvn_fs_fs-1-0.dll
libsvn_ra-1-0.dll
libsvn_ra_dav-1-0.dll
libsvn_ra_local-1-0.dll
libsvn_ra_svn-1-0.dll
libsvn_repos-1-0.dll
libsvn_subr-1-0.dll
libsvn_swig_perl-1-0.dll
libsvn_wc-1-0.dll
libz.dll
ln.exe
ls.exe
m4.exe
md5sum.exe
mkdir.exe
msmtp.exe
msys-1.0.dll
msys-crypto-1.0.0.dll
msys-minires.dll
msys-perl5_8.dll
msys-regex-1.dll
msys-ssl-1.0.0.dll
msys-z.dll
msysltdl-3.dll
mv.exe
openssl.exe
patch.exe
patch.exe.manifest
pdfinfo.exe
pdftotext.exe
perl.exe
printf
ps.exe
pthreadGC2.dll
pwd
rebase.exe
recodetree
rm.exe
rmdir.exe
rxvt.exe
scp.exe
sed.exe
sh.VisualElementsManifest.xml
sh.exe
sleep.exe
sort.exe
split.exe
ssh-add.exe
ssh-agent.exe
ssh-keygen.exe
ssh-keyscan.exe
ssh.exe
start
tail.exe
tar.exe
tcl85.dll
tclpip85.dll
tclsh.exe
tclsh85.exe
tee.exe
tk85.dll
touch.exe
tr.exe
true.exe
txt.txt
uname.exe
uniq.exe
unix2dos.exe
unzip.exe
vi
vim
vimtutor
wc.exe
which
wish.VisualElementsManifest.xml
wish.exe
wish85.exe
xargs.exe
yacc

 

 

          2. 安装TortoiseGit

              首先,要安装Windows Installer 4.5

              然后,安装TortoiseGit-1.8.8.0-32bit.msi(当前最新版本)

最后,安装TortoiseGit中文语言包

              TortoiseGit-LanguagePack-1.8.7.0-32bit-zh_CN.msi

二、配置、使用TortoiseGit

           1. 设置为中文界面

2. 建立版本库

               在任意空的文件夹点击鼠标右键,选择“Git 在这里创建版本库”

3. clone库

               在上面的文件夹点击右键,选择“拉取(Pull)”

(1) 管理远端

图2-3-1-1

图2-3-1-2

               其中,URL是远端版本库的git地址

注意,一定要把“localhost”改成IP地址,否则会出现如下错误:git did not exit cleanly (exit code 128)

(2) 生成PPK文件

这里提到的沟通桥梁就是通信中使用的密钥。TortoiseGit 使用扩展名为ppk的密钥,而不是ssh-keygen生成的rsa密钥。也就是说使用ssh-keygen -C "username@email.com" -t rsa产生的密钥在TortoiseGit中不能用。而基于github的开发必须要用到rsa密钥,因此需要用到TortoiseGit的putty key generator工具来生成既适用于github的rsa密钥也适用于TortoiseGit的ppk密钥。运行TortoiseGit开始菜单中的puttygen程序,点击“Generate”按钮,鼠标在上图的空白地方来回移动直到进度条完毕,就会自动生一个随机的key。

 

登录Github官网,点击右上角的"Account Settings",选择SSH Public Keys->Add another public key,将上面生成的Key粘贴进来,选择"Add Key"。公钥添加完毕。然后点击上面对话框中的"Save private key",将私钥保存在本地,文件后缀是ppk。

        运行TortoiseGit开始菜单中的Pageant程序,程序启动后将自动停靠在任务栏中,图标显示为,双击该图标,弹出key管理列表。点击"Add Key",选择刚才保存的ppk文件,这样私钥就添加到key管理列表中了。

 

在“开始”菜单,选择“TortoiseGit”中的“PuttyGen”

点击“Generate”按钮,然后,鼠标在图中红色方框的区域内不停的移动,即可生成密钥。

点击“Save private key”按钮,把生成的密钥保存为PPK文件。

确定生成。

保存到图2-3-1-2中的地址

 (3) 完成clone库

4. 提交本地版本库

               在本地版本库中新建立的文件图标均为

(1) 添加到本地库

                          鼠标右键点击如上图图标的文件,选择“增加”

 

这时,文件图标变为表示添加到本地库成功。

(2) 提交到本地库

                           鼠标右键点击如上图图标的文件,选择“Git提交(C) ... -> "master"...”

会出现提示,设置用户名和邮箱。

设置用户名、邮箱和签名密钥(PPK文件)

 输入日志信息,完成提交。

5. 推送本地库到服务器

               如果所有文件夹和文件的图标都如图所示,那么我们就可以把本地库推送到版本服务器了。

               在本地库所在根目录(本机为D:\mydoc13\ssfc),点击鼠标右键,选择“TortoiseGit”-〉“推送”

 完成推送。

 

------------------------------------------xiaobin_hlj80-----------------------------------------------全文End------------------------------

        FAQ:

              1. 关于:用户名和邮箱

                  用户名和邮箱,都是由版本服务器分配。就是我们在版本服务器建立用户名和邮箱,然后在客户端使用。

              2. 取消上次的“Commit”操作

                  右击git库文件夹,选择“Git”选项卡,点击“Show log”按钮,选择要回滚的位置,点击右键选择“Reset "master" to this...”

                  点击“ok”完成取消操作。


« 上一篇:wifi共享上网(至尊版wifi)
« 下一篇:libbson windows编译文档
在这里写下您精彩的评论
  • 微信

  • QQ

  • 支付宝

返回首页
返回首页 img
返回顶部~
返回顶部 img