Skip to content

Commit 61d59d2

Browse files
authored
Merge pull request #39 from FuTseYi/main
others: 🤗docs: translate and update Chapter content to English&simple optimization
2 parents 2bd16de + a4d800a commit 61d59d2

12 files changed

Lines changed: 1025 additions & 1096 deletions

File tree

docs/.vitepress/config.ts

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,7 @@ export default withMermaid(defineConfig({
159159
themeConfig: {
160160
nav: [
161161
{ text: 'Home', link: '/' },
162-
{
163-
text: 'Class Content',
164-
items: [
165-
{ text: 'Chapter 1 Git Introduction', link: '/lecture01/' },
166-
{ text: 'Chapter 2 Git Basic Commands', link: '/lecture02/' },
167-
{ text: 'Chapter 3 Git Branch Management', link: '/lecture03/' },
168-
{ text: 'Chapter 4 Git Tools', link: '/lecture04/' },
169-
{ text: 'Chapter 5 Git Internal Principles', link: '/lecture05/' },
170-
{ text: 'Chapter 6 GitFlow Workflow Practice', link: '/lecture06/' },
171-
{ text: 'Chapter 7 Git Commit Specification', link: '/lecture07/' },
172-
{ text: 'Chapter 8 Github/Gitee Usage', link: '/lecture08/' },
173-
{ text: 'Chapter 9 Git Visual Tools Download', link: '/lecture09/' },
174-
{ text: 'Chapter 10 Git Team Collaboration', link: '/lecture10/' }
175-
]
176-
},
162+
{ text: 'Class Content',link: '/lecture01/'},
177163
],
178164
// 由于 rewrites 已将 en 映射到根路径,侧边栏也使用根路径
179165
sidebar: createSidebar('docs/en', '/'),// '/'决定“链接挂到哪里”(这些文档对应的网站路径以哪个前缀开头)
@@ -189,21 +175,7 @@ export default withMermaid(defineConfig({
189175
themeConfig: {
190176
nav: [
191177
{ text: '主页', link: '/zh/' },
192-
{
193-
text: '课程内容',
194-
items: [
195-
{ text: '第一章 Git简介', link: '/zh/lecture01/' },
196-
{ text: '第二章 Git基础命令', link: '/zh/lecture02/' },
197-
{ text: '第三章 Git分支管理', link: '/zh/lecture03/' },
198-
{ text: '第四章 Git工具', link: '/zh/lecture04/' },
199-
{ text: '第五章 Git内部原理', link: '/zh/lecture05/' },
200-
{ text: '第六章 GitFlow工作流实战', link: '/zh/lecture06/' },
201-
{ text: '第七章 Git提交规范', link: '/zh/lecture07/' },
202-
{ text: '第八章 Github/Gitee使用说明', link: '/zh/lecture08/' },
203-
{ text: '第九章 Git可视化工具下载', link: '/zh/lecture09/' },
204-
{ text: '第十章 Git团队协作以及合并时的diff工具', link: '/zh/lecture10/' }
205-
]
206-
},
178+
{ text: '课程内容',link: '/zh/lecture01/'},
207179
],
208180
sidebar: createSidebar('docs/zh', '/zh/'),
209181

docs/en/lecture01/index.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,103 @@
1-
# 第一章 Git 简介
1+
# Chapter 1: Introduction to Git
22

3-
## 1.1 版本控制
3+
## 1.1 Version Control
44

5-
### 1.1.1 什么是版本控制系统?
5+
### 1.1.1 What is a Version Control System?
66

7-
大家平常有没有遇到这种情况:
7+
Have you ever encountered this situation:
88

9-
我们的初始代码能跑通,但是随着我们加新的功能时,加着加着发现代码出现了问题。有些同学可能会疯狂 ctrl+z 进行回退,这种方法太过麻烦。于是,我们想有没有一种系统,可以帮助我们记录我们对代码的变化,并且可以恢复到指定的某个版本的代码。
9+
Your initial code works perfectly, but as you add new features, you gradually discover that problems emerge in your code. Some developers might frantically press Ctrl+Z to revert changes, but this approach is far too cumbersome. This raises the question: is there a system that can help us track changes to our code and restore it to a specific version?
1010

11-
这种系统其实就是版本控制系统,有了它我们就可以将选定的文件回溯到之前的状态,甚至将整个项目都回退到过去某个时间点的状态,我们可以比较文件的变化细节,查出最后是谁修改了哪个地方,从而找出导致怪异问题出现的原因,又是谁在何时报告了某个功能缺陷等等。使用版本控制系统通常还意味着,就算我们乱来一气把整个项目中的文件改的改删的删,我们也照样可以轻松恢复到原先的样子。但额外增加的工作量却微乎其微。
11+
Such a system is precisely what we call a version control system. With it, we can revert selected files to their previous states, or even roll back the entire project to a specific point in time. We can compare detailed changes in files, identify who last modified which part, trace the root cause of peculiar issues, and determine who reported a particular bug and when. Using a version control system typically means that even if we recklessly modify or delete files throughout the entire project, we can easily restore everything to its original state with minimal additional effort.
1212

13-
### 1.1.2 集中式版本控制 vs 分布式版本控制系统
13+
### 1.1.2 Centralized Version Control vs. Distributed Version Control Systems
1414

15-
现有的版本控制系统主要有两种形式:集中式和分布式。
15+
Existing version control systems primarily come in two forms: centralized and distributed.
1616

17-
**集中式版本控制系统**:集中式版本库集中存放于一个单一的中央服务器的,保存所有文件的修订版本。在协同工作时,人们需要先从中央服务器取得最新的版本,然后开始干活,干完活了,再把自己的活推送给中央服务器。因此,集中式版本控制系统需要在联网的情况下才能工作。
17+
**Centralized Version Control Systems**: In centralized version control, the repository is stored on a single central server that maintains all file revision versions. When collaborating, people must first retrieve the latest version from the central server, complete their work, and then push their changes back to the central server. Therefore, centralized version control systems require network connectivity to function.
1818

1919
![](./figures/centralized.png)
2020

21-
集中式版本控制有一个很致命的缺点就是中央服务器的单点故障。 如果宕机一小时,那么在这一小时内,谁都无法提交更新,也就无法协同工作。 如果中心数据库所在的磁盘发生损坏,又没有做恰当备份,毫无疑问你将丢失所有数据——包括项目的整个变更历史,只剩下人们在各自机器上保留的单独快照。
21+
Centralized version control has a critical weakness: the single point of failure of the central server. If the server goes down for an hour, no one can commit updates or collaborate during that time. If the disk containing the central database becomes corrupted without proper backups, you will undoubtedly lose all data—including the entire change history of the project—leaving only individual snapshots that people have retained on their local machines.
2222

23-
**分布式版本控制系统**
23+
**Distributed Version Control Systems**:
2424

25-
分布式版本控制系统根本没有“中央服务器”,
25+
Distributed version control systems have no "central server" at all.
2626

27-
我们每次是把代码仓库完整地镜像下来,包括完整的历史记录。这使得每个人的电脑上都是一个完整的版本库。这么一来,任何一处协同工作用的服务器发生故障,事后都可以用任何一个镜像出来的本地仓库恢复。同时,我们也不需要像联网就可以进行工作。每个人电脑上都有一个完整的版本库,那多个人如何协作呢?比方说你在自己电脑上改了文件 A,你的同事也在他的电脑上改了文件 A,这时,你们俩之间只需把各自的修改推送给对方,就可以互相看到对方的修改了。
27+
Each time we clone a repository, we create a complete mirror of the codebase, including its entire history. This means that everyone's computer contains a complete version repository. Consequently, if any server used for collaboration fails, it can be restored afterward using any of the mirrored local repositories. Additionally, we don't need network connectivity to work. Since everyone has a complete repository on their computer, how do multiple people collaborate? For instance, if you modify file A on your computer and your colleague also modifies file A on their computer, you simply need to push your respective changes to each other to see each other's modifications.
2828

29-
但是在实际使用分布式版本控制系统的时候,其实很少在两人之间的电脑上推送版本库的修改,因为可能我们不在一个局域网内,两台电脑互相访问不了。因此,分布式版本控制系统通常也有一台充当“中央服务器”的电脑或者服务器,但这个服务器的作用仅仅是用来方便“交换”大家的修改,没有它大家也一样干活,只是交换修改不方便而已。这也是我们在 GitHub 建立 repo 的原因。
29+
However, in practice when using distributed version control systems, people rarely push repository changes directly between two computers, because we might not be on the same local network and the computers cannot access each other. Therefore, distributed version control systems typically also have a computer or server acting as a "central server," but this server's role is merely to facilitate the "exchange" of everyone's modifications. Without it, everyone can still work; it just makes exchanging modifications less convenient. This is why we create repositories on GitHub.
3030

3131
![](./figures/distributed.png)
3232

33-
## 1.2 Git 简介和历史
33+
## 1.2 Git Introduction and History
3434

35-
说到 Git 的诞生,我们就不得不提一下 Linux 之父 Linus TorvaldsLinuxLinux 内核开源项目有着为数众多的参与者。 绝大多数的 Linux 内核维护工作都花在了提交补丁和保存归档的繁琐事务上(19912002 年间)。到 2002 年,整个项目组开始启用一个专有的分布式版本控制系统 BitKeeper 来管理和维护代码。
35+
When discussing the birth of Git, we must mention Linus Torvalds, the father of Linux, and Linux itself. The Linux kernel open-source project has numerous contributors. The vast majority of Linux kernel maintenance work was spent on the tedious tasks of submitting patches and maintaining archives (from 1991 to 2002). By 2002, the entire project team began using a proprietary distributed version control system called BitKeeper to manage and maintain the code.
3636

37-
但是到了 2005 年,开发 BitKeeper 的商业公司认为 Linux 开发者内部有人对 BitKeeper 内部使用的协议进行逆向工程,因此他们收回了 Linux 内核社区免费使用 BitKeeper 的权力。 这就迫使 Linux 开源社区(特别是 Linux 的缔造者 Linus Torvalds)基于使用 BitKeeper 时的经验教训,开发出自己的版本系统。 他们对新的系统制订了若干目标:
37+
However, in 2005, the commercial company developing BitKeeper believed that someone within the Linux developer community had reverse-engineered the protocols used internally by BitKeeper, so they revoked the Linux kernel community's right to use BitKeeper for free. This forced the Linux open-source community (particularly Linus Torvalds, the creator of Linux) to develop their own version control system based on lessons learned from using BitKeeper. They established several goals for the new system:
3838

39-
- 速度
40-
- 简单的设计
41-
- 对非线性开发模式的强力支持(允许成千上万个并行开发的分支)
42-
- 完全分布式
43-
- 有能力高效管理类似 Linux 内核一样的超大规模项目(速度和数据量)
39+
- Speed
40+
- Simple design
41+
- Strong support for non-linear development (allowing thousands of parallel development branches)
42+
- Fully distributed
43+
- Ability to efficiently manage super-large-scale projects like the Linux kernel (in terms of speed and data volume)
4444

45-
于是在 Linux 之父 Linus Torvalds 的带领下用了 10 天编写出了第一个 Git 版本。自诞生以来,Git 日臻成熟完善,在高度易用的同时,仍然保留着初期设定的目标。 它的速度飞快,极其适合管理大项目,有着令人难以置信的非线性分支管理系统(参见 Git 分支)。
45+
Thus, under the leadership of Linus Torvalds, the father of Linux, the first version of Git was written in just 10 days. Since its inception, Git has matured and improved continuously, remaining highly user-friendly while retaining its initially set goals. It is incredibly fast, extremely suitable for managing large projects, and features an incredibly powerful non-linear branch management system (see Git Branching).
4646

47-
## 1.3 Git 的安装
47+
## 1.3 Installing Git
4848

49-
关于 Git 的安装,我们可以访问 Git book 所给的下载教程进行下载,我们在下面的几部分也是仅做简要叙述。具体链接 --> [安装 Git](https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-%E5%AE%89%E8%A3%85-Git)
49+
For Git installation, we can visit the download tutorial provided by the Git book. The following sections provide only brief descriptions. Specific link --> [Installing Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
5050

5151
### 1.3.1 Linux
5252

53-
我们可以在 terminal 输入 `git` 命令查看系统有没有安装 git。如果没有安装的话,我们可以访问 git 关于 linux 和 unix 的安装页面,输入对应的安装命令。网页链接 --> [Download for Linux and Unix](https://git-scm.com/download/linux)
53+
We can check whether Git is installed on the system by entering the `git` command in the terminal. If it's not installed, we can visit Git's installation page for Linux and Unix and enter the corresponding installation command. Web link --> [Download for Linux and Unix](https://git-scm.com/download/linux)
5454

55-
对于常见的 Debian Ubuntu Linux,我们可以通过
55+
For common Debian and Ubuntu Linux distributions, we can use:
5656

5757
```bash
5858
sudo apt-get install git
5959
```
6060

61-
就可以直接完成 Git 的安装。
61+
This will directly complete the Git installation.
6262

6363
### 1.3.2 Windows
6464

65-
在 Windows 上安装 Git 也有几种安装方法。 我们也可以打开 <https://git-scm.com/downloads> 进行下载安装。安装好后我们可以打开 Git bash。
65+
There are several methods to install Git on Windows. We can also open <https://git-scm.com/downloads> to download and install. After installation, we can open Git Bash.
6666

6767
![](./figures/Git_gui.png)
6868

69-
另一个简单的方法是安装 GitHub Desktop。 该安装程序包含图形化和命令行版本的 Git。 它也能支持 Powershell,提供了稳定的凭证缓存和健全的换行设置。
69+
Another simple method is to install GitHub Desktop. This installer includes both graphical and command-line versions of Git. It also supports PowerShell, provides stable credential caching, and proper line ending settings.
7070

7171
### 1.3.3 macOS
7272

73-
在 Mac 上安装 Git 有多种方式。 最简单的方法是安装 Xcode Command Line ToolsMavericks 10.9) 或更高版本的系统中,在 Terminal 里尝试首次运行 git 命令即可。
73+
There are multiple ways to install Git on Mac. The simplest method is to install Xcode Command Line Tools. On Mavericks (10.9) or higher systems, simply try running the git command for the first time in Terminal.
7474

7575
```bash
7676
git --version
7777
```
7878

79-
如果没有我们安装过命令行开发者工具,terminal 也会提示你安装。
79+
If you haven't installed the command-line developer tools, Terminal will prompt you to install them.
8080

81-
如果我们想安装更新的版本,可以使用二进制安装程序。 官方维护的 macOS Git 安装程序可以在 Git 官方网站下载,网址为 <https://git-scm.com/download/mac>
81+
If we want to install a more recent version, we can use the binary installer. The officially maintained macOS Git installer can be downloaded from the Git official website at <https://git-scm.com/download/mac>.
8282

83-
### 1.3.4 初次运行 Git 的配置
83+
### 1.3.4 First-Time Git Configuration
8484

85-
当我们安装好 Git 后,还需要在 Git bash 或者 terminal 进行一些相关设置,以下设置仅需设置一次即可。
85+
After installing Git, we need to perform some related settings in Git Bash or Terminal. The following settings only need to be configured once.
8686

8787
```bash
8888
git config --global user.name "Your Name"
8989
git config --global user.email "email@example.com"
9090
```
9191

92-
除此之外,Git 还有很多设置,包括常用编辑器等,大家可以键入以下命令查看自己的设置并进行修改。
92+
In addition, Git has many other settings, including commonly used editors. You can enter the following command to view your settings and make modifications.
9393

9494
```bash
9595
git config --list
9696
```
9797

98-
## 1.4 相关学习资源
98+
## 1.4 Related Learning Resources
9999

100-
在这里给大家推荐几个学习 Git 的资源,希望可以帮助大家在未来对 Git 有着更深的了解。
100+
Here are several resources for learning Git that can help you gain a deeper understanding of Git in the future.
101101

102102
- [Git Book](https://git-scm.com/book/zh/v2)
103103
- [廖雪峰Git教程](https://www.liaoxuefeng.com/wiki/896043488029600)

0 commit comments

Comments
 (0)