1、软件git
一、下载Git客户端软件github
Widows平台:windows
https://github.com/git-for-windows/git/releases/download/v2.13.0.windows.1/Git-2.13.0-64-bit.exebash
Mac OS X系统:ssh
二、TortoiseGit.net
安装包:blog
https://download.tortoisegit.org/tgit/2.4.0.0/TortoiseGit-2.4.0.2-64bit.msiget
语言包:源码
https://download.tortoisegit.org/tgit/2.4.0.0/TortoiseGit-LanguagePack-2.4.0.0-64bit-zh_CN.msi
2、Git SSH Key 配置
一、SSH Key 生成
a) 检查本机是否已经存在SSH Key:cd ~/.ssh
b) 设置Git的user name和email:
$ git config --global user.name "zhoumingjun"
$ git config --global user.email "zhoumingjun@purang.com"
c) 生存密钥:$ ssh-keygen -t rsa -C “zhoumingjun@purang.com”
按3个回车,密码为空。以下图:
d) 此时在windows用户下生成2个密钥文件:
二、SSH Key 配置
a) 打开Bitbucket进入
b) 添加SSH Key
将本地的公钥用文本打开全选copy,而后copy到Bitbucket上
保存以后,此时生成了一条SSH Key记录
3、Git 命令使用
一、获取源码,git clone ssh://git@10.1.110.21:7999/pbq/pbq.git
此时个人本地就已经有xxx的源码文件
二、添加一个文件c.txt,git add
三、将文件提交到仓库 git commit
四、推送本地更新到远程 git push
五、更新远程更新到本地 git pull
六、添加多个文件git add -A
七、删除文件及文件夹 git rm
4、TortoiseGit使用
一、获取源码 git clone
找到TortoiseGit安装的目录下找到puttygen.exe文件运行,选择经过git bash 生成的id_rsa密钥文件
而后保存带有.ppk后缀的文件名:id_rsa.ppk
右键Git clone,选择刚刚保存的私钥,点击OK,便可获取源码。
二、添加文件
右键TortoiseGit Add
点击Commit
选择Commit&Push 便可提交文件
三、更新远程更新到本地
四、其余操做:添加多个文件、撤销Commit等操做等都是图形化操做。