# git_learning **Repository Path**: cee2/git_learning ## Basic Information - **Project Name**: git_learning - **Description**: Git分享 - **Primary Language**: Python - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2023-04-27 - **Last Updated**: 2023-05-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: Git ## README # git_learn Git 是一个开源的分布式版本控制系统,可以有效、高速地处理从很小到非常大的项目版本管理。下面以 Gitee 为例,完成整个流程的介绍,可以基于本项目进行各种练习。 ## 下载 Git 基于 Gitee,我们准备了一个简易版本,可以参考这个[文档](./docs/install.md),也可以参考官方信息进行下载和配置: - 官方网站:[https://git-scm.com](https://git-scm.com) - 本地配置:[https://git-scm.com/book/zh/v2/自定义-Git-配置-Git](https://git-scm.com/book/zh/v2/%E8%87%AA%E5%AE%9A%E4%B9%89-Git-%E9%85%8D%E7%BD%AE-Git) ## 最常用操作 - 克隆: `git clone https://gitee.com/cee2/git_learning.git` - 新建分支: `git checkout -b ` - 添加内容到索引: `git add .` - 记录修改: `git commit -m ""` - 修改记录:`git commit --amend` - 推送远程仓库: `git push origion ` - 下拉远程仓库更新本地仓库: `git pull origin ` - 切换分支: `git checkout ` - 合并分支: `git merge ` - 删除分支:`git branch -D ` - 同步远程分支:`git remote prune origin` - 历史查看命令:`git log` - 回退上一个版本:`git reset --hard HEAD^` - 回退到任意版本:`git reset --hard ` 详细的操作可以参考这张[思维导图](./docs/imgs/git.jpg)。 ## 学习链接 1. [Learn Git Branching](https://learngitbranching.js.org/?locale=zh_CN) 2. [Git Book](https://git-scm.com/book/zh/v2) 3. [Git 教程 廖雪峰](https://www.liaoxuefeng.com/wiki/896043488029600) 4. [GitHub 入门与实践.pdf(下载)](https://next.a-boat.cn:2021/s/sARFF5SksFbs2mm) ## 高阶补充 1. [Git 仓库瘦身](https://www.cnblogs.com/bushuosx/p/10965485.html) 2. [添加合著者](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors) 3. [Git Reset 三种模式](https://www.jianshu.com/p/c2ec5f06cf1a) ## 尝试一下 1. 直接通过网站主页[修改内容](./docs/fixbyweb.md)。 2. 发起一个[Issue](https://gitee.com/cee2/git_learning/issues)或回复一个其他人的 Issue。 3. 为需要新开发的[功能](./src/functions.py)提交一个 PR。