git for windows+TortoiseGit客户端的使用

本文详细介绍了如何在Windows环境下安装Git客户端与TortoiseGit,并提供了从创建本地版本库到推送远程版本库的完整流程指导。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

    一、安装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”中的“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”完成取消操作。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值