没有合适的资源?快使用搜索试试~ 我知道了~
Git User’s Manual (for version 1.5.3 or later)
3星 · 超过75%的资源 需积分: 3 34 下载量 121 浏览量
2009-02-06
12:01:36
上传
评论
收藏 395KB PDF 举报
温馨提示
试读
61页
Git User’s Manual (for version 1.5.3 or newer) pdf version
资源推荐
资源详情
资源评论
Git User’s Manual (for version 1.5.3 or
newer)
1 / 61
Git User’s Manual (for version 1.5.3 or newer)
Git User’s Manual (for version 1.5.3 or
newer)
2 / 61
COLLABORATORS
TITLE : REFERENCE :
Git User’s Manual (for version 1.5.3 or newer)
ACTION NAME DATE SIGNATURE
WRITTEN BY October 19, 2007
REVISION HISTORY
NUMBER DATE DESCRIPTION NAME
Git User’s Manual (for version 1.5.3 or
newer)
3 / 61
Contents
1 Repositories and Branches 8
1.1 How to get a git repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2 How to check out a different version of a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3 Understanding History: Commits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3.1 Understanding history: commits, parents, and reachability . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3.2 Understanding history: History diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3.3 Understanding history: What is a branch? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.4 Manipulating branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5 Examining an old version without creating a new branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.6 Examining branches from a remote repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.7 Naming branches, tags, and other references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.8 Updating a repository with git fetch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.9 Fetching branches from other repositories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2 Exploring git history 14
2.1 How to use bisect to find a regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2 Naming commits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.3 Creating tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4 Browsing revisions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5 Generating diffs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.6 Viewing old file versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.7 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.7.1 Counting the number of commits on a branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.7.2 Check whether two branches point at the same history . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.7.3 Find first tagged version including a given fix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.7.4 Showing commits unique to a given branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.7.5 Creating a changelog and tarball for a software release . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.7.6 Finding commits referencing a file with given content . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Git User’s Manual (for version 1.5.3 or
newer)
4 / 61
3 Developing with git 20
3.1 Telling git your name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2 Creating a new repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.3 How to make a commit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.4 Creating good commit messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.5 Ignoring files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.6 How to merge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.7 Resolving a merge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.7.1 Getting conflict-resolution help during a merge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.8 Undoing a merge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.9 Fast-forward merges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.10 Fixing mistakes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.10.1 Fixing a mistake with a new commit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.10.2 Fixing a mistake by editing history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.10.3 Checking out an old version of a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.10.4 Temporarily setting aside work in progress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.11 Ensuring good performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.12 Ensuring reliability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.12.1 Checking the repository for corruption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.12.2 Recovering lost changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.12.2.1 Reflogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.12.2.2 Examining dangling objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4 Sharing development with others 29
4.1 Getting updates with git pull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.2 Submitting patches to a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.3 Importing patches to a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.4 Public git repositories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.4.1 Setting up a public repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.4.2 Exporting a git repository via the git protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.4.3 Exporting a git repository via http . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.4.4 Pushing changes to a public repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.4.5 Setting up a shared repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.4.6 Allowing web browsing of a repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.5 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.5.1 Maintaining topic branches for a Linux subsystem maintainer . . . . . . . . . . . . . . . . . . . . . . . 32
Git User’s Manual (for version 1.5.3 or
newer)
5 / 61
5 Rewriting history and maintaining patch series 37
5.1 Creating the perfect patch series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.2 Keeping a patch series up to date using git-rebase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.3 Modifying a single commit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.4 Reordering or selecting from a patch series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.5 Other tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.6 Problems with rewriting history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6 Advanced branch management 41
6.1 Fetching individual branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.2 git fetch and fast-forwards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.3 Forcing git fetch to do non-fast-forward updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
6.4 Configuring remote branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
7 Git internals 43
7.1 The Object Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
7.2 Blob Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
7.3 Tree Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.4 Commit Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.5 Trust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.6 Tag Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.7 The "index" aka "Current Directory Cache" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
7.8 The Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
7.8.1 working directory -> index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
7.8.2 index -> object database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
7.8.3 object database -> index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
7.8.4 index -> working directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
7.8.5 Tying it all together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
7.9 Examining the data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.10 Merging multiple trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.11 Merging multiple trees, continued . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.12 How git stores objects efficiently: pack files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.13 Dangling objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.14 A birds-eye view of Git’s source code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
8 GIT Glossary 53
剩余60页未读,继续阅读
资源评论
- 秦罡2012-11-15不是真正的git manual,内容不全。
huangxu008
- 粉丝: 1
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- yolov5,SSD 可能使用到的一些代码
- 介绍离散性制造行业的MES系统流程
- 基于IDEA-CCNL/Randeng-Pegasus-238M-Summary-Chines微调的中文文本摘要任务源码+数据集
- 微信小程序源码 车源宝 二手车交易平台 源码下载
- 微信小程序源码 实现 城市切换 demo 根据城市首字母排序城市 选择城市 源码下载
- 2024新版计算机编译原理期末速成全套视频教程(视频+配套资料)
- VMware7.0虚拟机硬盘无法编辑,无法连接到Profile-Driven Storage Service
- arm64内核的mongo镜像
- 基于stm32f103c单片机+MPU6050+0.96英寸OLED显示屏双柄遥控器硬件(原理图+PCB)工程文件.zip
- 整理的关于少儿编程的学习路径,以及如何在小升初,初升高和大学充分的利用起来编程经验的优势
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功