Git学习记录(一):安装与配置

一、Git安装:

  • Linux系统自带:终端中输入git即可
  • Windows系统安装:
  • 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指定分支/标签即可。

五、其他

posted @ 2024-03-30 11:00  梦一场6688  阅读(36)  评论(0)    收藏  举报