Git学习记录(一):安装与配置
一、Git安装:
- Linux系统自带:终端中输入
git即可 - Windows系统安装:
- git下载: https://git-scm.com/download/win
- 将git添加至环境变量
git --version查看git版本

二、Git配置:
git config --global --list用于查看git配置信息,主要包括邮箱email和姓名name
PS C:\Users\qiyh> git config --global --list
core.editor="D:\Microsoft VS Code\bin\code" --wait
user.email=842273556@qq.com
user.name=qiyh
git config --global user.email "you@example.com"设置邮箱git config --global user.name "Your Name"设置姓名- 去掉
--global表示仅对该repo生效
修改的配置会保存在.gitconfig文件中,Windows用户目录:D:\Users\Xiaoming; Linux用户目录:vim ~/.gitconfig
参考链接:https://blog.csdn.net/qwaszx523/article/details/79072276
三、Git Messages
git config commit.template .gitmessage.txt
其中.gitmessage.txt为git commit message模板文件
四、git使用
- 下载仓库到本地
git clone https://github.com/pjreddie/darknet.git以Yolov3(Darknet)为例 - 下载仓库中的指定分支(Branch)/标签(Tag)
git clone -b tag1 xxx.git使用-b指定分支/标签即可。
五、其他
- VSCode Git插件: Git Graph: https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph
- 如何利用AI来分析某个commit提交:https://poe.com/s/76G5uFc7ZZAzbzFMIQcc
- 具体步骤:
- 提取commit的msg, 比较不同文件之间的diff, 把commit-msg和diff给AI大模型分析

浙公网安备 33010602011771号