惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
罗磊的独立博客
博客园 - 聂微东
T
The Blog of Author Tim Ferriss
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
F
Fortinet All Blogs
A
About on SuperTechFans
腾讯CDC
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed
IT之家
IT之家
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
宝玉的分享
宝玉的分享
C
Check Point Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
爱范儿
爱范儿
Microsoft Security Blog
Microsoft Security Blog
月光博客
月光博客
T
Tailwind CSS Blog
The Cloudflare Blog
Hugging Face - Blog
Hugging Face - Blog

博客园 - stonespawn

Vue 组件库2 Vue 的组件库 算法小题目 VS2019 自动代码补全功能 GIT 删除操作 vue-router 注意事项 Vue中axios访问 后端跨域问题 Vue2.0 搭配 axios Vue 脚手架搭建 grunt使用入门 Ajax在调用含有SoapHeader的webservice方法 关于JS 树形结构 导出EXCEL【Web方式HTML通过拼接html中table】 链接点击跳动问题 WatiN——Web自动化测试(三)【弹出窗口处理】 WatiN——Web自动化测试(二) WatiN——Web自动化测试(一) 网页调用服务程序 - stonespawn - 博客园 小问题 小技巧 :创建虚拟目录并将IIS里面.net配置版本设为2.0 - stonespawn
Git相关操作及记录
stonespawn · 2017-05-11 · via 博客园 - stonespawn

一、软件

1、下载Git客户端软件

Widows平台:

https://github.com/git-for-windows/git/releases/download/v2.13.0.windows.1/Git-2.13.0-64-bit.exe

Mac OS X系统:

https://sourceforge.net/projects/git-osx-installer/files/git-2.13.0-intel-universal-mavericks.dmg/download?use_mirror=autoselect

2、TortoiseGit

安装包:

https://download.tortoisegit.org/tgit/2.4.0.0/TortoiseGit-2.4.0.2-64bit.msi

语言包:

https://download.tortoisegit.org/tgit/2.4.0.0/TortoiseGit-LanguagePack-2.4.0.0-64bit-zh_CN.msi

二、Git SSH Key 配置

1、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个密钥文件:

 

2、SSH Key 配置

a) 打开Bitbucket进入

 

b) 添加SSH Key

将本地的公钥用文本打开全选copy,然后copy到Bitbucket上

 

保存之后,此时生成了一条SSH Key记录

 

三、Git 命令使用

1、获取源码,git clone  ssh://git@10.1.110.21:7999/pbq/pbq.git

 

此时我的本地就已经有xxx的源码文件

 

2、添加一个文件c.txt,git add

 

3、将文件提交到仓库 git commit

 

4、推送本地更新到远程 git push

 

5、更新远程更新到本地 git pull

 

6、添加多个文件git add -A

 

7、删除文件及文件夹 git rm

 

四、TortoiseGit使用

1、获取源码 git clone

 

找到TortoiseGit安装的目录下找到puttygen.exe文件运行,选择通过git bash 生成的id_rsa密钥文件

 

然后保存带有.ppk后缀的文件名:id_rsa.ppk

 

右键Git clone,选择刚刚保存的私钥,点击OK,即可获取源码。

2、添加文件

右键TortoiseGit Add

点击Commit

 

选择Commit&Push 即可提交文件

3、更新远程更新到本地

 

4、其他操作:添加多个文件、撤销Commit等操作等都是图形化操作。