企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## 一、概述 Git是分布式版本控制系统,相对的是集中式版本控制系统,典型的有SVN; ## 二、安装配置 https://git-scm.com/download/win ![](https://img.kancloud.cn/cd/1d/cd1d66e2003fe9212418d10ea1b8d5dd_1366x736.png) 在上述地址,下载Git-2.25.0-64-bit.exe; 1、开始安装 ![](https://img.kancloud.cn/19/81/1981be192ce82517b3988f97dd1a2f5d_503x389.png) 2、一路配置,保留默认即可 ![](https://img.kancloud.cn/ae/15/ae153a92535ab06755311cae2fb0b942_503x389.png) 基本都是按照默认配置即可; 3、安装完成,安装程序自动把${gitroot}/cmd写入系统环境变量Path中;完成安装之后,就可以使用命令行的 git 工具(已经自带了 ssh 客户端)了,另外还有一个图形界面的 Git 项目管理工具。 ![](https://img.kancloud.cn/7f/23/7f23d600470ee24b9fecb9c18e77841b_677x443.png) ## 三、Git GUI图形用户界面 Git for Windows因此提供了Git GUI, 一个强大的Git Bash替代品, 提供几乎所有Git命令行功能的图形版本, 以及全面的可视化差异比较工具。 ![](https://img.kancloud.cn/e6/c2/e6c2a54a4b2f5b90134ab31736314d6c_857x542.png) ## 三、基本操作 使用Git前,需要先建立一个仓库(repository)。您可以使用一个已经存在的目录作为Git仓库或创建一个空目录。 ### 创建全新仓库: ``` git init ``` ![](https://img.kancloud.cn/8e/75/8e75730130fd9062ed7a1b9a8e81adcc_608x59.png) ### 克隆库 ``` git clone https://github.com/projecturl ``` ![](https://img.kancloud.cn/44/d0/44d0773250bfb4f8e0fa50e377d472f3_652x125.png) ## 四、实例 ~~~ # clone the project git clone https://github.com/PanJiaChen/vue-admin-template.git # enter the project directory cd vue-admin-template # install dependency npm install # develop npm run dev ~~~ ![](https://img.kancloud.cn/80/b6/80b653de7e1f1d5065e4b09fbaf57547_677x443.png) ![](https://img.kancloud.cn/8a/54/8a54b23242229971263844c2fa72c9e6_677x443.png) ## 五、常见问题 git clone执行的时候,有时候,会因为网络速度的问题,导致失败,多尝试几次即可: ![](https://img.kancloud.cn/0b/7a/0b7a1be3598b901f8a5ceb76cd72f25d_645x114.png)