资讯详情

Git pepsi-wyl

版本控制

简介

版本控制(Revision control)它是一种软件工程技术,用于管理我们在开发过程中修改文件、目录或工程的历史,便于查看和更改历史记录,并备份以恢复以前版本的软件工程技术。 简单来说就是用来管理多人协同开发项目的技术。

  • 跨区域多人协同发展
  • 追踪和记录一个或多个文件的历史记录
  • 组织和保护您的源代码和文档
  • 统计工作量
  • 并行开发,提高开发效率
  • 跟踪记录整个软件的开发过程
  • 减轻开发人员的负担,节省时间,减少人为错误
没有版本控制或版本控制本身缺乏正确的过程管理,软件开发过程中会出现很多问题,如软件代码 一致性、软件内容冗余、软件过程的事物性、软件开发过程的并发性、软件源代码的安全性以及软件 整合等问题。 

版本控制工具

  • (Subversion)
  • (Concurrent Versions System)
  • (Micorosoft Visual SourceSafe)
  • (Team Foundation Server)
  • Visual Studio Online

版本控制分类

**本地版本控制 **RCS

每次更新记录文件时,可以为每个版本制作快照或补丁文件,适合个人使用

所有版本的数据都保存在服务器上,协同开发者从服务器上同步更新或上传自己的修改

所有版本数据都存在于服务器上,用户的本地版本只有他们以前的同步版本。如果没有连接到互联网,用户将看不到历史 版本不能切换版本验证问题,也不能在不同的分支工作。此外,所有数据都保存在单个服务器上,风险很大 服务器会损坏,从而丢失所有数据,当然可以定期备份。代表产品:SVN、CVS、VSS 

控制分布式版本 Git

所有版本的信息仓库都与每个本地用户同步,这样你就可以在本地查看所有版本的历史,并在本地离线提交,只需连接网络push去相应的服务器或其他用户。因为每个用户都保存所有版本的数据,只要用户的设备没有问题,所有的数据都可以恢复,但这增加了当地存储空间的占用。

每个人都有所有的代码!安全隐患! 不会因为服务器损坏或网络问题而无法工作! 

Git与SVN的主要区别

SVN

SVN它是一个集中版本控制系统。版本库集中在中央服务器上,工作时使用自己的计算机。因此,我们应该首先从中央服务器获得最新版本,然后工作。完成工作后,我们需要将完成的工作推送到中央服务器。集中版本控制系统必须在网络上工作,对网络带宽要求较高。

GIT

Git它是一个没有中央服务器的分布式版本控制系统。每个人的电脑都是一个完整的版本库。工作时不需要联网,因为版本在自己的电脑上。协作的方法是这样的:例如,我在电脑上更改了文件A,其他人也在电脑上更改文件A,这时,你们俩只需要把自己的修改推给对方,就能看到对方的修改。Git您可以直接看到更新的代码和文件!

GIT基础

历史

Linux 内核开源项目有广泛的参与者。绝大多数的 Linux 核心维护工作花在繁琐的事务上,提交补丁并保存归档(1991-2002年)。到 2002 年,整个项目组开始使用专有的分布式版本控制系统 BitKeeper 管理和维护代码。Linux社区中存在很多的大佬!破解研究 BitKeeper ! 到了 2005 年,开发 BitKeeper 商业公司是一样的 Linux 核开源社区的合作关系已经结束,他们已经恢复了 Linux 免费使用内核社区 BitKeeper 的权力。这就迫使 Linux 开源社区(尤其是 Linux 的缔造者 Linus Torvalds)基于使用 BitKeeper 经验教训,开发自己的版本系统。(2周左右!) 也就是后来 Git!

安装

下载

GIT官网 在这里插入图片描述

安装

安装包

许可声明

安装路径

选择组件

在开始菜单中创建的名称

在开始菜单中创建名称,名称,直接点击Next”按钮 插入图片描述

Git默认文件编辑器

默认Vim可以直接点Next按钮进入下一个界面 ![image.png](https://img-blog.csdnimg.cn/img_convert/2e47dac21b6d9d961340a4e75b1df216.png#clientId=u3e5ffbaf-67c7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=348&id=u10d5b110&margin=[object Object]&name=image.png&originHeight=390&originWidth=498&originalType=binary&ratio=1&rotation=0&showTitle=false&size=26835&status=done&style=none&taskId=u7130dd7f-2c79-47cc-a380-acc436f4a53&title=&width=444)

新仓库初始分支的名称

新仓库初始分支的名称默认为master” ![image.png](https://img-blog.csdnimg.cn/img_convert/5f731525998a5e7526225ab93c132106.png#clientId=u3e5ffbaf-67c7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=348&id=ue5bf3b5b&margin=[object Object]&name=image.png&originHeight=396&originWidth=500&originalType=binary&ratio=1&rotation=0&showTitle=false&size=32258&status=done&style=none&taskId=u99f7bfcc-c120-4f68-a213-e0aaa730c2d&title=&width=440)

调整Path环境

![image.png](https://img-blog.csdnimg.cn/img_convert/4e294cb0c3f7cd0d8e3e4b54f421f40c.png#clientId=u3e5ffbaf-67c7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=336&id=uab7dc6bc&margin=[object Object]&name=image.png&originHeight=390&originWidth=502&originalType=binary&ratio=1&rotation=0&showTitle=false&size=38007&status=done&style=noneamp;taskId=u32ea6cc5-f884-4b76-968e-6078f2f3dca&title=&width=432) 第一种配置是“仅从Git Bash使用Git”。这是最安全的选择,因为您的PATH根本不会被修改。你只能使用 Git Bash 的 Git 命令行工具。但是这将不能通过第三方软件使用。 第二种配置是“从命令行以及第三方软件进行Git”。该选项被认为是安全的,因为它仅向PATH添加了一些最小的Git包装器,以避免使用可选的Unix工具造成环境混乱。 你将能够从Git Bash,命令提示符和Windows PowerShell以及在PATH中寻找Git的任何第三方软件中使用Git。这也是推荐的选项。 第三种配置是“从命令提示符使用Git和可选的Unix工具”。警告:这将覆盖Windows工具,如 “ find 和 sort ”。只有在了解其含义后才使用此选项。

选择SSH可执行文件

![image.png](https://img-blog.csdnimg.cn/img_convert/16756278a66d2ca38f4653158b079fb0.png#clientId=u3e5ffbaf-67c7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=396&id=u8639a301&margin=[object Object]&name=image.png&originHeight=396&originWidth=503&originalType=binary&ratio=1&rotation=0&showTitle=false&size=25865&status=done&style=none&taskId=ua3195697-f848-4bc6-b8ee-9a74a7d4f2d&title=&width=503)

选择HTTPS后端传输

![image.png](https://img-blog.csdnimg.cn/img_convert/c47233407718d86a787fc9b656e66c12.png#clientId=u3e5ffbaf-67c7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=391&id=u0f1bf8c4&margin=[object Object]&name=image.png&originHeight=391&originWidth=500&originalType=binary&ratio=1&rotation=0&showTitle=false&size=23252&status=done&style=none&taskId=u46272134-ad3a-4195-84aa-709f5a82ec1&title=&width=500) 第一个选项是“使用 OpenSSL 库”。服务器证书将使用ca-bundle.crt文件进行验证。这也是我们常用的选项。 第二个选项是“使用本地 Windows 安全通道库”。服务器证书将使用Windows证书存储验证。此选项还允许您使用公司的内部根CA证书,例如通过Active Directory Domain Services 。

配置行尾符号转换

![image.png](https://img-blog.csdnimg.cn/img_convert/bcd582d2fd1bef07eb854f875753cea1.png#clientId=u3e5ffbaf-67c7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=390&id=u28fdb7e1&margin=[object Object]&name=image.png&originHeight=390&originWidth=501&originalType=binary&ratio=1&rotation=0&showTitle=false&size=35454&status=done&style=none&taskId=ua2380ae4-c494-4232-b7a5-879be777c45&title=&width=501) 第一个选项是“签出Windows风格,提交Unix风格的行尾”。签出文本文件时,Git会将LF转换为CRLF。提交文本文件时,CRLF将转换为LF。对于跨平台项目,这是Windows上的推荐设置(“ core.autocrlf”设置为“ true”) 第二个选项是“按原样签出,提交Unix样式的行尾”。签出文本文件时,Git不会执行任何转换。 提交文本文件时,CRLF将转换为LF。对于跨平台项目,这是Unix上的建议设置(“ core.autocrlf”设置为“ input”) 第三种选项是“按原样签出,按原样提交”。当签出或提交文本文件时,Git不会执行任何转换。不建议跨平台项目选择此选项(“core.autocrlf”设置为“ false”)

配置用于Git Bash的终端模拟器

![image.png](https://img-blog.csdnimg.cn/img_convert/e875cefa0d9d9f4c020058b78cd66861.png#clientId=u3e5ffbaf-67c7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=391&id=uf8e38bbe&margin=[object Object]&name=image.png&originHeight=391&originWidth=495&originalType=binary&ratio=1&rotation=0&showTitle=false&size=31060&status=done&style=none&taskId=uf4161a4b-cdf3-4bce-84a3-8abbbbdd892&title=&width=495) 第一个选项是“使用MinTTY(MSYS2的默认终端)”。Git Bash将使用MinTTY作为终端模拟器,该模拟器具有可调整大小的窗口,非矩形选择和Unicode字体。Windows控制台程序(例如交互式Python)必须通过“ winpty”启动才能在MinTTY中运行。 第二个选项是“使用Windows的默认控制台窗口”。Git将使用Windows的默认控制台窗口(“cmd.exe”),该窗口可以与Win32控制台程序(如交互式Python或node.js)一起使用,但默认的回滚非常有限,需要配置为使用unicode 字体以正确显示非ASCII字符,并且在Windows 10之前,其窗口不能自由调整大小,并且只允许矩形文本选择。

选择git pull的默认行为

![image.png](https://img-blog.csdnimg.cn/img_convert/fcd8d90743eeba3637b6dfaa0f704323.png#clientId=u3e5ffbaf-67c7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=391&id=ua6751bf0&margin=[object Object]&name=image.png&originHeight=391&originWidth=499&originalType=binary&ratio=1&rotation=0&showTitle=false&size=25017&status=done&style=none&taskId=u450f6bd0-4050-4a91-9f90-05cc3ff87c8&title=&width=499) 第一个选项:默认值(快进或合并) 这是“git pull”的标准行为:尽可能将当前分支快速转发到获取的分支,否则创建合并提交 第二个选项:复位 将当前分支复位到获取的分支上。如果没有要重新设置基础的本地提交,这相当于快进。 第三个选项:只有快进 快进到获取的分支。如果不能获取,则失败。

配置凭证管理器

![image.png](https://img-blog.csdnimg.cn/img_convert/2af2cc127c9054c99671cf2873fcbe62.png#clientId=u3e5ffbaf-67c7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=396&id=u8b10b6d1&margin=[object Object]&name=image.png&originHeight=396&originWidth=501&originalType=binary&ratio=1&rotation=0&showTitle=false&size=27221&status=done&style=none&taskId=u7fa3a679-1bcd-4191-a304-c537c57eaa1&title=&width=501) 第一个选择项:Git凭证管理器 第一个选择项:无,不要使用凭证管理器

配置额外选项

![image.png](https://img-blog.csdnimg.cn/img_convert/9a1aa1a0e65228048bfe43abc813fb3e.png#clientId=u3e5ffbaf-67c7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=394&id=u5c84376d&margin=[object Object]&name=image.png&originHeight=394&originWidth=498&originalType=binary&ratio=1&rotation=0&showTitle=false&size=25010&status=done&style=none&taskId=u9d2fb817-b747-4aa6-9f7b-8c2f155017e&title=&width=498) 第一个选项:“启用文件系统缓存”。文件系统数据将被批量读取并缓存在内存中用于某些操作(“core.fscache”设置为“true”)。 这提供了显著的性能提升。 第二个选项:“启用符号链接”。启用符号链接(需要SeCreateSymbolicLink权限)。请注意,现有存储库不受此设置的影响。

配置实验选项

![image.png](https://img-blog.csdnimg.cn/img_convert/92a2c11db0b70076f8700e452d15d449.png#clientId=u3e5ffbaf-67c7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=389&id=u1cf9fb15&margin=[object Object]&name=image.png&originHeight=389&originWidth=498&originalType=binary&ratio=1&rotation=0&showTitle=false&size=24094&status=done&style=none&taskId=u17ddc220-e450-471a-9904-1a1b0cfd32a&title=&width=498) 第一个选项:启用对伪控制台的实验性支持。 (新增!)这允许在git bash窗口中运行Node或Python之类的本机控制台程序,而无需使用winpty,但它仍然存在已知的bug。 第二个选项:启用实验性内置文件系统监视器 (新增!)自动运行内置的文件系统监视程序,以加速包含许多文件的工作树中的常见操作,如“git status”、“git add”、“git commit”等。

git自动根据配置开始安装

![image.png](https://img-blog.csdnimg.cn/img_convert/3d31c9a04c5c816a83eb150d5630daf5.png#clientId=u3e5ffbaf-67c7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=391&id=u94d1875a&margin=[object Object]&name=image.png&originHeight=391&originWidth=499&originalType=binary&ratio=1&rotation=0&showTitle=false&size=16227&status=done&style=none&taskId=u6c97a6ec-0419-454b-b095-df66e666d01&title=&width=499)

安装完成

![image.png](https://img-blog.csdnimg.cn/img_convert/2373cc8f667ceab024f52b10ff7a707e.png#clientId=u3e5ffbaf-67c7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=393&id=ub6e735e9&margin=[object Object]&name=image.png&originHeight=393&originWidth=499&originalType=binary&ratio=1&rotation=0&showTitle=false&size=18925&status=done&style=none&taskId=u75aa25df-c734-4078-8db2-eaf3b207c7a&title=&width=499)

测试

Git Bash

使用最多 Linux命令格式 ![image.png](https://img-blog.csdnimg.cn/img_convert/1dd642af2aa28ba2d4895701cea9cccb.png#clientId=u2e3db38d-0059-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=310&id=ue161b0dd&margin=[object Object]&name=image.png&originHeight=369&originWidth=577&originalType=binary&ratio=1&rotation=0&showTitle=false&size=11200&status=done&style=none&taskId=uf4f09efe-a336-402c-a205-cd8e77a6d6d&title=&width=485)

Git CMD(Deprecated)

![image.png](https://img-blog.csdnimg.cn/img_convert/781d2d4cec92ee69939b2d599e52aa48.png#clientId=u2e3db38d-0059-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=257&id=u0a287c4a&margin=[object Object]&name=image.png&originHeight=450&originWidth=859&originalType=binary&ratio=1&rotation=0&showTitle=false&size=11967&status=done&style=none&taskId=uefb88690-2a38-4409-9859-ee0d82ff00f&title=&width=491)

Git GUI

![image.png](https://img-blog.csdnimg.cn/img_convert/d4fa20e5bf785b69b7508234281009d5.png#clientId=u2e3db38d-0059-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=259&id=u24ef3eb2&margin=[object Object]&name=image.png&originHeight=262&originWidth=495&originalType=binary&ratio=1&rotation=0&showTitle=false&size=11086&status=done&style=none&taskId=u2b7e508c-f406-4391-830c-7617a35dbfa&title=&width=489)

卸载

清除环境变量

![image.png](https://img-blog.csdnimg.cn/img_convert/6e92686b2b3d44fa5b2312211d7e4bd1.png#clientId=u3e5ffbaf-67c7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=564&id=u5edd31e1&margin=[object Object]&name=image.png&originHeight=564&originWidth=525&originalType=binary&ratio=1&rotation=0&showTitle=false&size=45643&status=done&style=none&taskId=uda6601a9-7c86-4683-bcc6-52b662516eb&title=&width=525)

卸载软件

![image.png](https://img-blog.csdnimg.cn/img_convert/882a9cfe254d632466166d95933590b3.png#clientId=u3e5ffbaf-67c7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=540&id=u81a86194&margin=[object Object]&name=image.png&originHeight=540&originWidth=1123&originalType=binary&ratio=1&rotation=0&showTitle=false&size=82487&status=done&style=none&taskId=ua4cc3886-4471-4d6b-9cc5-fa8fd1079d6&title=&width=1123)

配置

查看配置

#查看配置 
git config -l

#查看系统config
git config --system --list

#查看当前用户(global)配置
git config --global  --list

![image.png](https://img-blog.csdnimg.cn/img_convert/2e8d17c3e6d334e6ed8efd47baa4cd53.png#clientId=u2e3db38d-0059-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=319&id=ue7ad7988&margin=[object Object]&name=image.png&originHeight=319&originWidth=561&originalType=binary&ratio=1&rotation=0&showTitle=false&size=23321&status=done&style=none&taskId=ue17a4b63-feeb-456e-992c-742f68bd409&title=&width=561) ![image.png](https://img-blog.csdnimg.cn/img_convert/709c24590d6dd8a5514bce715bc47b9e.png#clientId=u2e3db38d-0059-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=242&id=u62f52958&margin=[object Object]&name=image.png&originHeight=236&originWidth=497&originalType=binary&ratio=1&rotation=0&showTitle=false&size=17328&status=done&style=none&taskId=u469410de-a2e2-4e43-ad27-1aff66bd252&title=&width=509) ![image.png](https://img-blog.csdnimg.cn/img_convert/dcfb7c1a5a372945aa8fd3ca755c83c0.png#clientId=u2e3db38d-0059-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=114&id=u2ced853c&margin=[object Object]&name=image.png&originHeight=124&originWidth=556&originalType=binary&ratio=1&rotation=0&showTitle=false&size=9017&status=done&style=none&taskId=uaf91f7a7-6e2f-442f-8a35-edcddec0df8&title=&width=509)

Git\etc\gitconfig  :Git 安装目录下的 gitconfig     --system 系统级
C:\Users\Lenovo\ .gitconfig    只适用于当前登录用户的配置  --global 全局

![image.png](https://img-blog.csdnimg.cn/img_convert/e2b0c040892e07d10e91cc618e18c0ca.png#clientId=u2e3db38d-0059-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=509&id=u496f043b&margin=[object Object]&name=image.png&originHeight=509&originWidth=779&originalType=binary&ratio=1&rotation=0&showTitle=false&size=28778&status=done&style=none&taskId=u4ee3ab1e-cbd0-418e-8082-b97b954a25a&title=&width=779) ![image.png](https://img-blog.csdnimg.cn/img_convert/904c85b49c34fe34b6dd8a23180890b5.png#clientId=u2e3db38d-0059-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=271&id=ub825ec2c&margin=[object Object]&name=image.png&originHeight=271&originWidth=799&originalType=binary&ratio=1&rotation=0&showTitle=false&size=16110&status=done&style=none&taskId=u0376f712-2945-4bdd-b762-2bbfb4d9645&title=&width=799)

配置用户名和邮箱

git config --global user.name "pepsi-wyl"  #名称
git config --global user.email 2322535585@qq.com   #邮箱

当你安装Git后首先要做的事情是设置你的用户名称和e-mail地址。 这是非常重要的,因为每次Git提交都会使用该信息,它被永远的嵌入到了你的提交中

GIT基本理论

本地区域

下面这个图展示了工作区、版本库中的暂存区和版本库之间的关系:![image.png](https://img-blog.csdnimg.cn/img_convert/e1326be1a4b9d66b9b6cb06fc90254fe.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=399&id=u4f1eda89&margin=[object Object]&name=image.png&originHeight=399&originWidth=775&originalType=binary&ratio=1&rotation=0&showTitle=false&size=263486&status=done&style=none&taskId=u5428f7e6-8a92-42df-b73b-75dd35ab833&title=&width=775)

  • 图中左侧为工作区,右侧为版本库。在版本库中标记为 “index” 的区域是暂存区(stage/index),标记为 “master” 的是 master 分支所代表的目录树。

  • 图中我们可以看出此时 “HEAD” 实际是指向 master 分支的一个"游标"。所以图示的命令中出现 HEAD 的地方可以用 master 来替换。

  • 图中的 objects 标识的区域为 Git 的对象库,实际位于 “.git/objects” 目录下,里面包含了创建的各种对象及内容。

  • 当对工作区修改(或新增)的文件执行 命令时,暂存区的目录树被更新,同时工作区修改(或新增)的文件内容被写入到对象库中的一个新的对象中,而该对象的ID被记录在暂存区的文件索引中。

  • 当执行提交操作(git commit)时,暂存区的目录树写到版本库(对象库)中,master 分支会做相应的更新。即 master 指向的目录树就是提交时暂存区的目录树。

  • 当执行 命令时,暂存区的目录树会被重写,被 master 分支指向的目录树所替换,但是工作区不受影响。

  • 当执行 命令时,会直接从暂存区删除文件,工作区则不做出改变。

  • 当执行 或者 命令时,会用暂存区全部或指定的文件替换工作区的文件。这个操作很危险,会清除工作区中未添加到暂存区中的改动。

  • 当执行 或者 命令时,会用 HEAD 指向的 master 分支中的全部或者部分文件替换暂存区和以及工作区中的文件。这个命令也是极具危险性的,因为不但会清除工作区中未提交的改动,也会清除暂存区中未提交的改动。

四个区域

Git本地有三个工作区域

  • 工作区(Working Directory)

    平时存放项目代码的地方
    
  • 暂存区(Stage/Index)

    用于临时存放你的改动 (它只是一个文件,保存即将提交到文件列表信息)
    
  • 版本库(Repository或Git Directory)

    安全存放数据的位置,这里面有你提交到所有版本的数据
    

Git远程有一个工作区域

  • git仓库(Remote Directory)

    远程仓库,托管代码的服务器
    

![image.png](https://img-blog.csdnimg.cn/img_convert/ee2210491ef6db0d8cb86b329a352ddb.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=428&id=UZPyh&margin=[object Object]&name=image.png&originHeight=428&originWidth=459&originalType=binary&ratio=1&rotation=0&showTitle=false&size=55676&status=done&style=none&taskId=uec98d1a5-45d2-4caa-9e92-2a31b3efff3&title=&width=459)

工作流程

在工作目录中添加、修改文件 将需要进行版本管理的文件放入暂存区域 将暂存区域的文件提交到git仓库 git管理的文件有三种状态:已修改(modified),已暂存(staged),已提交(committed) ![image.png](https://img-blog.csdnimg.cn/img_convert/99326e1402d2118fcec0c79957e8dcec.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=508&id=u29848ec0&margin=[object Object]&name=image.png&originHeight=508&originWidth=657&originalType=binary&ratio=1&rotation=0&showTitle=false&size=161950&status=done&style=none&taskId=u8225761f-d6e1-4d65-b10d-430a820c5f3&title=&width=657)

GIT基本操作

创建仓库

创建全新仓库

在执行完成 命令后,Git 仓库会生成一个 .git 目录,该目录包含了资源的所有元数据,其他的项目目录保持不变。

#使用当前目录作为Git仓库
git init

#指定目录作为Git仓库
git init newrepo

![image.png](https://img-blog.csdnimg.cn/img_convert/7c2867778aef1aad18eb4fdd2c264ffa.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=113&id=u23bc57b0&margin=[object Object]&name=image.png&originHeight=113&originWidth=472&originalType=binary&ratio=1&rotation=0&showTitle=false&size=7003&status=done&style=none&taskId=ubc07234e-306d-4cb8-ac4d-e689337292c&title=&width=472) ![image.png](https://img-blog.csdnimg.cn/img_convert/ace98dccdee75c13b29d2d5d3c1a1a30.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=92&id=u0764cc01&margin=[object Object]&name=image.png&originHeight=92&originWidth=601&originalType=binary&ratio=1&rotation=0&showTitle=false&size=5365&status=done&style=none&taskId=u59f6d5f8-bbfb-4b33-8b78-3dba0b380a6&title=&width=601)

克隆远程仓库

#使用当前目录作为Git仓库
git clone git@github.com:pepsi-wyl/Spring.git

#指定目录作为Git仓库
git clone git@github.com:pepsi-wyl/Spring.git  newrepo

SSH URL ![image.png](https://img-blog.csdnimg.cn/img_convert/282446c0b0019b7cf594e38286bd3a39.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=297&id=u443e405e&margin=[object Object]&name=image.png&originHeight=630&originWidth=1114&originalType=binary&ratio=1&rotation=0&showTitle=false&size=100866&status=done&style=none&taskId=u69032bcb-3394-4cad-a53b-3294bfb6031&title=&width=526) ![image.png](https://img-blog.csdnimg.cn/img_convert/a5cdb7a8e2cf380c7dc26e8945d20dde.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=120&id=u21f28fbf&margin=[object Object]&name=image.png&originHeight=122&originWidth=538&originalType=binary&ratio=1&rotation=0&showTitle=false&size=12392&status=done&style=none&taskId=u97643754-bc60-4f2d-9967-b7ecd12e961&title=&width=529) ![image.png](https://img-blog.csdnimg.cn/img_convert/c590b772cfb7bc9b88a92ba36b098fa7.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=213&id=u84ef07d1&margin=[object Object]&name=image.png&originHeight=266&originWidth=662&originalType=binary&ratio=1&rotation=0&showTitle=false&size=21852&status=done&style=none&taskId=u6b00cc63-5249-499c-87b7-a31a47ed9e2&title=&width=531)

提交日志

#查看历史提交记录
git log

#查看历史提交记录 (精简)
git reflog

![image.png](https://img-blog.csdnimg.cn/img_convert/ea73f5667dbedf783433827dfb1b8195.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=87&id=nAliI&margin=[object Object]&name=image.png&originHeight=110&originWidth=512&originalType=binary&ratio=1&rotation=0&showTitle=false&size=9177&status=done&style=none&taskId=u1a523182-cb60-483a-8579-0b4d3f306e3&title=&width=406) ![image.png](https://img-blog.csdnimg.cn/img_convert/5a1fbfb25030179331f4f90e1e022991.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=68&id=dly1C&margin=[object Object]&name=image.png&originHeight=78&originWidth=467&originalType=binary&ratio=1&rotation=0&showTitle=false&size=8817&status=done&style=none&taskId=u324b1b45-fff8-4166-8e3e-3b871943459&title=&width=408)

提交与修改

查看仓库状态

#查看所有文件状态
git status

#查看指定文件状态
git status [filename]

![image.png](https://img-blog.csdnimg.cn/img_convert/ef6bb832d08e050aecb57d8b98c48522.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=176&id=ueec3082f&margin=[object Object]&name=image.png&originHeight=196&originWidth=482&originalType=binary&ratio=1&rotation=0&showTitle=false&size=11484&status=done&style=none&taskId=u50d5d8a6-5d01-480f-8849-4312d9969b9&title=&width=434)

文件添加暂存区

# 添加当前目录下的所有文件到暂存区
git add .

# 添加指定目录到暂存区,包括子目录
git add [dir]

# 添加一个或多个文件到暂存区
git add [file1] [file2] ...

![image.png](https://img-blog.csdnimg.cn/img_convert/1f9c6247cb6551a55ef5cbb96808d35f.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=193&id=uc51d321c&margin=[object Object]&name=image.png&originHeight=193&originWidth=398&originalType=binary&ratio=1&rotation=0&showTitle=false&size=13349&status=done&style=none&taskId=u22cfe1c2-6d66-4fa5-abc0-7ca52a5dddc&title=&width=398)

暂存区添加本地仓库

# 提交暂存区到本地仓库中
git commit -m [message]

# 交暂存区的指定文件到仓库区
git commit [file1] [file2] ... -m [message]
# 参数设置修改文件后不需要执行 git add 命令,直接来提交
git commit -a

![image.png](https://img-blog.csdnimg.cn/img_convert/f4f6a69f43abf17ebc5ed2a89caedfb3.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=174&id=u6105ac05&margin=[object Object]&name=image.png&originHeight=162&originWidth=392&originalType=binary&ratio=1&rotation=0&showTitle=false&size=11869&status=done&style=none&taskId=uf77bfe10-01dc-4317-a70a-3fcd44cbf52&title=&width=421)

版本穿梭

# 版本切换
git reset --hard 版本号

![image.png](https://img-blog.csdnimg.cn/img_convert/1f9da6083e53b01b2bc6dc488650505d.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=201&id=QLIIz&margin=[object Object]&name=image.png&originHeight=233&originWidth=488&originalType=binary&ratio=1&rotation=0&showTitle=false&size=23886&status=done&style=none&taskId=u8960631f-3636-48a1-ab82-51b9b72e1fa&title=&width=422)

删除,移动,重命名文件

# 将文件从暂存区和工作区中删除
git rm [file]  

# 删除之前修改过并且已经放到暂存区域的话,则必须要用强制删除选项 -f
git rm -f [file]   

# 文件从暂存区域移除,但工作区保留
git rm --cached [file]  
## 必须要在暂存区或者文件commit之后才能进行rename

# 用于移动或重命名一个文件、目录或软连接
git mv [file] [newfile]

# 新文件名已经存在,但还是要重命名它,可以使用 -f 参数
git mv -f [file] [newfile]

分支管理

![image.png](https://img-blog.csdnimg.cn/img_convert/a871b9f2c60ff5624c03bef6d34896f6.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=292&id=u77faa014&margin=[object Object]&name=image.png&originHeight=314&originWidth=791&originalType=binary&ratio=1&rotation=0&showTitle=false&size=61197&status=done&style=none&taskId=u4378b9e1-c395-4786-a979-d244756c38c&title=&width=736)

简介

在版本控制过程中,同时推进多个任务,为每个任务,我们就可以创建每个任务的单独分支。 使用分支意味着程序员可以把自己的工作从开发主线上分离开来, 开发自己分支的时候,不会影响主线分支的运行。 好处

  • 同时并行推进多个功能开发,提高开发效率
  • 各个分支在开发过程中,如果某一个分支开发失败,不会对其他分支有任何影响。失败的分支删除重新开始即可

对于初学者而言,分支可以简单理解为副本,一个分支就是一个单独的副本。(分支底层其实也是指针的引用) ![image.png](https://img-blog.csdnimg.cn/img_convert/e30ca6bfdc540928b788339cf0ea2dec.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=367&id=ud8a19c2c&margin=[object Object]&name=image.png&originHeight=367&originWidth=779&originalType=binary&ratio=1&rotation=0&showTitle=false&size=66834&status=done&style=none&taskId=u2a602724-5c96-4acd-b877-ce534acc446&title=&width=779)

基本操作

查看分支

# 查看分支
git branch

# 查看分支 带版本号
git branch -v

![image.png](https://img-blog.csdnimg.cn/img_convert/fd27ceccc61d504027ba0ed367f672c8.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=51&id=u2a6058ed&margin=[object Object]&name=image.png&originHeight=51&originWidth=400&originalType=binary&ratio=1&rotation=0&showTitle=false&size=5085&status=done&style=none&taskId=u86a7aedc-4c38-409d-9db6-bdeab7a9e4d&title=&width=400)

创建分支

# 创建分支 依然停留在当前分支
git branch 分支名

# 新建一个分支 并切换到该分支
git checkout -b 分支名

![image.png](https://img-blog.csdnimg.cn/img_convert/9e9fe9284fccbf362073bf10d7dbbb9c.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=127&id=udc8daf92&margin=[object Object]&name=image.png&originHeight=127&originWidth=396&originalType=binary&ratio=1&rotation=0&showTitle=false&size=11060&status=done&style=none&taskId=u83203174-83cc-4689-87da-ae3b1def4a8&title=&width=396)

切换分支

# 切换分支
git checkout 分支名

![image.png](https://img-blog.csdnimg.cn/img_convert/befbde1155c6dc4ba072317820a9616b.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=137&id=u1adca4cb&margin=[object Object]&name=image.png&originHeight=137&originWidth=405&originalType=binary&ratio=1&rotation=0&showTitle=false&size=12609&status=done&style=none&taskId=u3d5e8ed5-63e5-4749-8756-72cd631546c&title=&width=405)

合并分支

# 合并分支
git merge 分支名

在 master 分支上合并 hot-fix 分支(将hot-fix的合并到master) ![image.png](https://img-blog.csdnimg.cn/img_convert/fbc654629e035722e6aabb04243f99b8.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=110&id=u718e8b55&margin=[object Object]&name=image.png&originHeight=110&originWidth=454&originalType=binary&ratio=1&rotation=0&showTitle=false&size=8717&status=done&style=none&taskId=u2f6e684f-ec4d-4d8f-8947-5517fd0eaaa&title=&width=454)

合并冲突

两个分支在同一个文件的同一个位置有两套完全不同的修改,Git 无法替我们决定使用哪一个

1.mater分支进行修改 t.c 并且提交 ![image.png](https://img-blog.csdnimg.cn/img_convert/d12142a4e7fbad8a8fd41c7d1a494ab0.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=180&id=u796e46ee&margin=[object Object]&name=image.png&originHeight=180&originWidth=406&originalType=binary&ratio=1&rotation=0&showTitle=false&size=13932&status=done&style=none&taskId=u27a81d0b-6a31-4be1-a8f2-70b1a30b002&title=&width=406) 2.hot-fix分支进行修改 t.c 并且提交 ![image.png](https://img-blog.csdnimg.cn/img_convert/2aa8b130d7b73c1535735f54503de422.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=98&id=u3f52f1bd&margin=[object Object]&name=image.png&originHeight=102&originWidth=454&originalType=binary&ratio=1&rotation=0&showTitle=false&size=9279&status=done&style=none&taskId=u9c572a47-e430-451c-a5b6-0d2650e5b5f&title=&width=438)![image.png](https://img-blog.csdnimg.cn/img_convert/0622ffb85aec2f38fcda1958267ab52f.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=114&id=u4f436b60&margin=[object Object]&name=image.png&originHeight=123&originWidth=472&originalType=binary&ratio=1&rotation=0&showTitle=false&size=10728&status=done&style=none&taskId=ube0efbe9-d5bf-40b3-a8fd-8e56d7e1f27&title=&width=438) 3.合并冲突 ![image.png](https://img-blog.csdnimg.cn/img_convert/8c3fc5d91cb2e96253f317cdce015283.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=92&id=u567469dc&margin=[object Object]&name=image.png&originHeight=94&originWidth=595&originalType=binary&ratio=1&rotation=0&showTitle=false&size=10347&status=done&style=none&taskId=u9c7dfc71-dfd1-4169-84eb-fc9cfbb15e4&title=&width=582) 4.解决合并冲突 人文编辑该文件 ![image.png](https://img-blog.csdnimg.cn/img_convert/2628185ee346b8ee38c469b26e3a3aca.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=41&id=u6caa79fb&margin=[object Object]&name=image.png&originHeight=41&originWidth=464&originalType=binary&ratio=1&rotation=0&showTitle=false&size=4107&status=done&style=none&taskId=udfbaea11-1c5e-4ecd-a798-5fbe6c0c13d&title=&width=464) ![image.png](https://img-blog.csdnimg.cn/img_convert/c0aad915f03880e6384bcec6e1eb15dd.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=153&id=ubd124d5f&margin=[object Object]&name=image.png&originHeight=132&originWidth=398&originalType=binary&ratio=1&rotation=0&showTitle=false&size=4276&status=done&style=none&taskId=u7416f4ee-540e-47bb-bded-095ff366081&title=&width=460) ![image.png](https://img-blog.csdnimg.cn/img_convert/b4c40f986ba8023e33d2a28279c12aa7.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=163&id=u300b7790&margin=[object Object]&name=image.png&originHeight=120&originWidth=340&originalType=binary&ratio=1&rotation=0&showTitle=false&size=3264&status=done&style=none&taskId=u9cb1b803-69dc-461d-93a3-02772a72ab1&title=&width=463) 5.合并成功 ![image.png](https://img-blog.csdnimg.cn/img_convert/5eaf8aec580e86654104bd2fa375b7c7.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=181&id=uf3016327&margin=[object Object]&name=image.png&originHeight=181&originWidth=601&originalType=binary&ratio=1&rotation=0&showTitle=false&size=19343&status=done&style=none&taskId=uffdf636b-5156-4f01-95dc-476fd500a74&title=&width=601)

删除分支

# 删除分支
git branch -d 分支名

![image.png](https://img-blog.csdnimg.cn/img_convert/bd28cfae57acf568c919b4a0a835b992.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=124&id=u4761f562&margin=[object Object]&name=image.png&originHeight=124&originWidth=394&originalType=binary&ratio=1&rotation=0&showTitle=false&size=10429&status=done&style=none&taskId=u27bfb0e7-2b24-42e9-a6f2-25a54975283&title=&width=394)

远程操作

SSHKey

生成SSHKey

# 四次回车 默认在用户目录下,如:C:\User\xxx\.ssh\
ssh-keygen -t rsa -C "2322535585@qq.com"

查看SSHKey

![image.png](https://img-blog.csdnimg.cn/img_convert/dc986f4aa77948491db8b0a0c7d39b89.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=24&id=UAijS&margin=[object Object]&name=image.png&originHeight=31&originWidth=801&originalType=binary&ratio=1&rotation=0&showTitle=false&size=3467&status=done&style=none&taskId=u4f7c083e-ab56-4e15-bbd8-eca07291a79&title=&width=626) ![image.png](https://img-blog.csdnimg.cn/img_convert/8106906352f488709e28db083a9d3670.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=24&id=HcjOY&margin=[object Object]&name=image.png&originHeight=23&originWidth=603&originalType=binary&ratio=1&rotation=0&showTitle=false&size=2852&status=done&style=none&taskId=u7dc73a21-836a-49c9-a0f5-8c9041adfa2&title=&width=626) ![image.png](https://img-blog.csdnimg.cn/img_convert/4d82b88dd85c8194e8cd17f7ca883218.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=207&id=EQuf9&margin=[object Object]&name=image.png&originHeight=314&originWidth=954&originalType=binary&ratio=1&rotation=0&showTitle=false&size=81121&status=done&style=none&taskId=u2d243f7f-b303-411c-ae2f-b64958411ea&title=&width=628)

GitHub配置

![image.png](https://img-blog.csdnimg.cn/img_convert/4bd9bd4d4d20d614735d29af5ff4bbb8.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=678&id=SAIiy&margin=[object Object]&name=image.png&originHeight=678&originWidth=1582&originalType=binary&ratio=1&rotation=0&showTitle=false&size=83551&status=done&style=none&taskId=u6af051a7-f040-4562-a795-4b8a720d944&title=&width=1582) ![image.png](https://img-blog.csdnimg.cn/img_convert/527e36064c7cc073be4ec580438dc12d.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=602&id=dHyGt&margin=[object Object]&name=image.png&originHeight=602&originWidth=1514&originalType=binary&ratio=1&rotation=0&showTitle=false&size=87762&status=done&style=none&taskId=u8ccd0d00-2b96-4145-ba04-c7aaf477dd7&title=&width=1514) ![image.png](https://img-blog.csdnimg.cn/img_convert/f5cdc8dca6a97eb0050350fa33556c31.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=287&id=aGUlq&margin=[object Object]&name=image.png&originHeight=287&originWidth=416&originalType=binary&ratio=1&rotation=0&showTitle=false&size=16676&status=done&style=none&taskId=uaff69a79-0dba-4c38-b234-78b34826556&title=&width=416)

Gitee配置

![image.png](https://img-blog.csdnimg.cn/img_convert/90b4e9064cb14ecf45acdc60db2e0399.png#clientId=u8827b4e5-31ec-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=302&id=u7cf6bd79&margin=[object Object]&name=image.png&originHeight=576&originWidth=1243&originalType=binary&ratio=1&rotation=0&showTitle=false&size=71414&status=done&style=none&taskId=u96ec47c9-b949-44e7-a39f-bd3efe98700&title=&width=652) ![image.png](https://img-blog.csdnimg.cn/img_convert/5c5a65ed62f78255632550a4bff5cf93.png#clientId=u8827b4e5-31ec-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=59&id=uf08a68b6&margin=[object Object]&name=image.png&originHeight=88&originWidth=970&originalType=binary&ratio=1&rotation=0&showTitle=false&size=8581&status=done&style=none&taskId=u9cad644f-00d7-4957-a74f-9872e82304f&title=&width=645) ![image.png](https://img-blog.csdnimg.cn/img_convert/42628588361997c53f8ee1b669369518.png#clientId=u8827b4e5-31ec-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=167&id=u7630b3b3&margin=[object Object]&name=image.png&originHeight=202&originWidth=554&originalType=binary&ratio=1&rotation=0&showTitle=false&size=21547&status=done&style=none&taskId=u675ba440-b183-4677-932d-b0bf3863174&title=&width=457)

GitHub创建远程库

![image.png](https://img-blog.csdnimg.cn/img_convert/3e4c5d977accf2c91fb98e5bcb75a0c8.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=438&id=u379b4453&margin=[object Object]&name=image.png&originHeight=438&originWidth=1249&originalType=binary&ratio=1&rotation=0&showTitle=false&size=65745&status=done&style=none&taskId=ucea34cc4-dcc5-4963-8460-79a4da827ed&title=&width=1249) ![image.png](https://img-blog.csdnimg.cn/img_convert/633665039bf710d3940ea25cce048be5.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=516&id=u6f7420f4&margin=[object Object]&name=image.png&originHeight=516&originWidth=996&originalType=binary&ratio=1&rotation=0&showTitle=false&size=50310&status=done&style=none&taskId=uaa6c5af0-18e1-46db-9c87-801e68d3893&title=&width=996) ![image.png](https://img-blog.csdnimg.cn/img_convert/d25e3ffc538de3ba6ec379e0251bec71.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=168&id=u2770a6bb&margin=[object Object]&name=image.png&originHeight=168&originWidth=1191&originalType=binary&ratio=1&rotation=0&showTitle=false&size=24740&status=done&style=none&taskId=ub1aff628-850f-4eca-8863-39d372bd3da&title=&width=1191)

添加远程库

可以指定一个简单的名字,以便将来引用 尽量命名为本地库的名称

# 查看当前所有远程地址别名
git remote -v 

# 创建远程地址别名
git remote add 别名 远程仓库链接

![image.png](https://img-blog.csdnimg.cn/img_convert/d771e6c7a2ba2eb34e10610f52075579.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=113&id=u907bb470&margin=[object Object]&name=image.png&originHeight=141&originWidth=543&originalType=binary&ratio=1&rotation=0&showTitle=false&size=14641&status=done&style=none&taskId=ud520e7e8-9171-4566-86aa-6e01493b585&title=&width=434)

删除远程库

# 删除远程库
git remote rm [别名]

![image.png](https://img-blog.csdnimg.cn/img_convert/c8c7d253d0a56524f5b9a9603f4d6ffb.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=92&id=ud1c9684b&margin=[object Object]&name=image.png&originHeight=92&originWidth=430&originalType=binary&ratio=1&rotation=0&showTitle=false&size=7978&status=done&style=none&taskId=u8a3ddfad-32b8-480a-acd1-21baf300bb7&title=&width=430)

推送远程库

提交代码至远程库

# 推送远程库
git push [远程库url 或 远程库别名] 分支名

![image.png](https://img-blog.csdnimg.cn/img_convert/58e5677e8475e7f1f95718bb6b5afbac.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=201&id=u3bb85dea&margin=[object Object]&name=image.png&originHeight=201&originWidth=539&originalType=binary&ratio=1&rotation=0&showTitle=false&size=23076&status=done&style=none&taskId=u5c21b696-7ae6-4f29-ada3-99861a9396f&title=&width=539)

拉取远程库

远程GitHub修改代码 本地需要同步

# 拉取远程库
git pull [远程库url 或 远程库别名] 分支名

![image.png](https://img-blog.csdnimg.cn/img_convert/fd6eba1bdc7b248296dcab41e658bf5e.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=353&id=u1adce867&margin=[object Object]&name=image.png&originHeight=353&originWidth=550&originalType=binary&ratio=1&rotation=0&showTitle=false&size=32414&status=done&style=none&taskId=u5ae17efd-c820-42e4-8af3-b76074ad625&title=&width=550)

克隆远程库

# 克隆远程库
git clone 远程库地址

# clone 会做如下操作
- 拉取代码   
- 初始化本地仓库  
- 创建别名

![image.png](https://img-blog.csdnimg.cn/img_convert/dae4dbba31f7e222168ee1625ac9b09a.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=143&id=ud34521cd&margin=[object Object]&name=image.png&originHeight=130&originWidth=491&originalType=binary&ratio=1&rotation=0&showTitle=false&size=13379&status=done&style=none&taskId=u57914edf-4e00-4400-8bd2-e6ef062232e&title=&width=541) ![image.png](https://img-blog.csdnimg.cn/img_convert/e9ef76c7b0ee0c5932a0ff3c85d286fe.png#clientId=u1f433071-cfa7-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=64&id=u89519804&margin=[object Object]&name=image.png&originHeight=57&originWidth=485&originalType=binary&ratio=1&rotation=0&showTitle=false&size=6268&status=done&style=none&taskId=u63ddbe27-3b11-4abe-b24f-1f160e12187&title=&width=545)

团队合作

团队内的成员才可以对 远程库进行push

添加成员

![image.png](https://img-blog.csdnimg.cn/img_convert/05ca4b60bdcdd290eac08ce1d893b77c.png#clientId

标签: j30j矩形连接器ada10红外光电传感器st198a二极管ppm3fd201e0

锐单商城拥有海量元器件数据手册IC替代型号,打造 电子元器件IC百科大全!

锐单商城 - 一站式电子元器件采购平台