git win7上面的使用TortoiseGit to Git
TortoiseGit提交项目到GitLab配置
操作系统 win7 64
TortoiseGit TortoiseGit-2.5.0.0-64bit
Git Git-2.16.0.2-64-bit
Putty putty-64bit-0.70-installer
下载地址:
链接:https://pan.baidu.com/s/1pNsUodX 密码:h37h
一.部署前的准备工作
安装TortoiseGit,Git,Putty,默认下一步安装即可.
二.配置PuTTY authentication agent
在安装TortoiseGit后,可以选择使用OpenSSH客户端还是使用Putty客户端,如果使用的是默认的Putty客户端,由于TortoiseGit GUI连接不支持server端自定义端口配置,若GitLab使用的SSH端口为自定义端口,则需要使用PuTTY的authentication agent去做一个本地的端口转发.

1.首先使用TortoiseGit自带的Puttygen创建本地的公/私钥对

2.点击Generate按钮,在窗口空白处按照提示晃动鼠标,生成公/私钥对,并保存到本地
其中testkey为公钥,testkey.ppk为私钥


3.将窗口生成的Public key粘贴到GitLab站点具体使用账号的SSh Keys内即完成公钥上传.


4.使用PuTTY连接gitlab服务器,TortoiseGit自带了PuTTy,即Pageant。




open之前需选择之前本地生成的私钥文件,配置完成。
5.连接成功会在右下角任务栏出现任务图标

三.配置TortoiseGit
1.从windows开始菜单选择TortoiseGit-Setting工具,在对话框里选择Git项,填写相关info

2.在D盘新建一个目录,例如"D:Git",并进入目录右键目录空白处选择"Git Create repository here...",弹出对话框点确认,这样即建立了一个本地Git仓库.


3.在该仓库目录下创建一个测试项目文本文件,右键目录空白处,选择Git Commit -> "master" ...,在弹出对话框里输入提示注释,选择要加入的版本控制文件,确定即可提交.


4.现在只是在本地实现使用Git管理项目,在此界面若显示Success则本地提交成功,接下来点击Push..,把我们的改动递交到Git服务器上.

5.此时会弹出Push对话框,在Ref - Remote栏里设定当前分支名为master,然后点击Destination - Remote栏的Manage按钮.

6.在弹出的设置对话框中按照如图所示,填写服务器Remote名称,URL(git@git.yanwenbo.cn:root/tesproject.git),之前保存的本地私钥testkey.ppk,点击Add New/Save按钮保存这一设置,然后点击确定退出返回之前的对话框.

7.最终确认提交

8.push成功

9. Giblab后台查看提交结果.


10强制更新到后台的最新版本:
1选择检出

2选择覆盖工作树
