git下载及基础

git学习教程:【【GeekHour】一小时Git教程】 https://www.bilibili.com/video/BV1HM411377j/?share_source=copy_web\&vd_source=1a32dd27a726236a74603cf06b7302aa

1. 下载

官网:https://git-scm.com/

终端输入 git -v 能看到版本信息表示安装成功

windows自动安装了git bash,右键可打开终端(注:可直接在某项目文件夹右键打开)

2. Git使用方式

命令行,UI,IDE(本教程使用命令行方式)

常用命令如下:

3. 配置用户和邮箱

bash 复制代码
git config --global user.name "Your Name" #用户名有空格所以加""
git config --global user.email "your.email@example.com"

git config --global credential.helper store #保存配置信息 不用每次都输入
git config --global --list #查看刚配置的信息

注:省略(local):本地配置,只对本地仓库有效

-global:全局配置,所有仓库生效

-system:系统配置,对所有用户生效

4. 新建仓库

创建仓库的两种方式:git init、git clone

(1)git init

(上述新建目录会导致文件夹存放在默认的C盘,可直接在目标文件夹右键打开Git后添加为仓库)

.git为隐藏文件,不要随意删除里面的内容否则仓库被破坏/消失

bash 复制代码
git init my_repo #若现在在某文件夹下使用该命令表示对某文件夹下的my_repo创建仓库

(2)git clone

直接 git clone + url

以github上的yolov5为例:

相关推荐
-拟墨画扇-5 小时前
Git | 分支管理操作
git·gitee·github·gitcode
ModestCoder_5 小时前
Git 版本管理教程
大数据·git·elasticsearch
YMGogre5 小时前
Git 提交信息规范
git
charlie1145141916 小时前
Git团队协作完全入门指南(下)
git
golang学习记8 小时前
Facebook 为什么不用 Git?
git·elasticsearch·facebook
GIS阵地9 小时前
git拉取时报错
大数据·git·elasticsearch
无限进步_12 小时前
C++ Vector 全解析:从使用到深入理解
开发语言·c++·ide·windows·git·github·visual studio
charlee4412 小时前
Git使用经验总结9-Git提交关联到Issue
git·issue
-拟墨画扇-12 小时前
Git | Bug分支操作
git·gitee·github·bug·gitcode
-拟墨画扇-14 小时前
Git | Feature分支操作
git·gitee·github·gitcode