Skip to content

Commit b7aacff

Browse files
authored
Updated language
Improved English
1 parent b04474e commit b7aacff

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

getting_started/python-client/lesson_6.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# Lesson 6 - Version control: time travel, branching and rebase
1+
# Lesson 6 - Version control: Time travel, branching, and rebase
22

3-
> **_NOTE:_** from version 10.1.0 the cli command is `tdbpy` instead of `terminusdb`
3+
> **_NOTE:_** from version 10.1.0 the CLI command is `tdbpy` instead of `terminusdb`
44
5-
In this lesson about version control, we will be doing some git like operation that can let us collaborate and time travel.
5+
In this lesson about version control, we will be doing some Git like operation that enables collaborate and time travel.
66

7-
## Branch, creating a copy and jump between versions
7+
## Branch, create a copy and jump between versions
88

9-
Let's follow the Awesome Startup again. Now they are super busy and decided to hire a few contractors to help out in the current project which will last for a few months. They would like to get the contractors details into the database, so they have to make a branch and ask the contractors to "fill in the details" in the branched database.
9+
We'll be using the Awesome Startup example again. Now the company is super busy and decided to hire a few contractors to help out for a few months. They would like to get the contractor's details into the database, so they want to make a branch of the database and get the contractors to "fill in the details" in this branch.
1010

11-
Making a branch is like making a copy of the database. The good thing about this operation is that, if the contractors has does something wrong and accidentally modify the data that they should not be modifying, the changes will only be remained in the branched database. It gives the managers chances to review the changes before adopting the change in the main database.
11+
Making a branch is like making a copy of the database. The good thing about this operation is that, if a contractor does something wrong and accidentally modifies data that they shouldn't, the changes will only apply in the branched version. It allows managers to review changes before adopting the change in the main database.
1212

13-
To make a branch, we can use the `tdbpy branch` or `tdbpy checkout -b` command. The difference is that `tdbpy branch` will create a new branch WITHOUT going (checkout) to that branch, while `tdbpy checkout` is used to go to another branch but with option `-b` you will create that new branch before going there.
13+
To make a branch, we use the `tdbpy branch` or `tdbpy checkout -b` command. The difference is that `tdbpy branch` will create a new branch WITHOUT going (checkout) to that branch, while `tdbpy checkout` is used to go to another branch. With the option `-b` you will create that new branch before going there.
1414

15-
Before we create the branch, let see what we have for now:
15+
Before creating the branch, let us first see what we have:
1616

1717
```
1818
$ tdbpy branch
1919
main
2020
```
2121

22-
We only have the `main` branch. The `main` branch is the default branch that is created when you created a new database. Let's create the new barnch:
22+
We only have the `main` branch. The `main` branch is the default branch that is created when you create a database. Let's create the new branch:
2323

2424
```
2525
$ tdbpy branch contractors
@@ -34,19 +34,19 @@ main
3434
contractors
3535
```
3636

37-
Now the contractors can add their details with the script [add_contractors.py](add_contractors.py). We add the two contractors in similar manner as adding Ethan in [lesson 4](lesson_4.md) but notice one thing:
37+
Now the contractors can add their details with a script [add_contractors.py](add_contractors.py). We add the two contractors in similar way as we added Ethan in [lesson 4](lesson_4.md) but notice one thing:
3838

3939
```python
4040
client.connect(db="getting_started", branch="contractors")
4141
```
4242

43-
When we connect to the database, we have to specify the branch to be `contractors`.
43+
When we connect to the database, we have to specify the branch as `contractors`.
4444

4545
Now run the script:
4646

4747
`$ python add_contractors.py`
4848

49-
To verify we did things right, let's see if there is any changes in the current `main` branch, you can see all the logs with:
49+
To verify we did things right, let's see if there are any changes in the current `main` branch, you can see all the logs with:
5050

5151
```
5252
$ tdbpy log
@@ -88,7 +88,7 @@ Date: 2021-10-15 11:48:29
8888
8989
```
9090

91-
So the last time we make changes is adding Ethan, the contractors are not added here.
91+
So the last time we made changes was when we added Ethan. Contractors have not been added.
9292

9393
Now let's go to the `contractors` branch:
9494

@@ -121,9 +121,9 @@ We have a new entry for the log.
121121

122122
## Rebase, what is it about?
123123

124-
After the `contractors` branch is created and "filled in". Our managers approve the change. Now, we would like to incorporate the changes back to the main branch. For those of you who are familiar with the git workflow will know that we need to perform a merge from the `contractors` branch to the `main` branch. But we are going to do something a bit difference here, using rebase instead of merge.
124+
After the `contractors` branch is created and "filled in". Our managers approve the change. Now, we would like to incorporate the changes back to the main branch. For those who are familiar with Git workflow, you will know that we need to perform a merge from the `contractors` branch to the `main` branch. But we are going to do something a bit difference here, using rebase instead of merge.
125125

126-
Rebase means that we take the changes we made since the branching and will continue from another branch. For example, if we rebase `main` from `contractors` we will continue from what `contractors` is now, i.e. after adding the contractors. This means we have incorporate the change in `contractors` into `main`. For more information about rebase, see the [documentation with git](https://git-scm.com/docs/git-rebase).
126+
Rebase means that we take the changes we made since the branching and will continue from another branch. For example, if we rebase `main` from `contractors` we will continue from what `contractors` is now, i.e. after adding the contractors. This means that we have incorporated the change in `contractors` into `main`. For more information about rebase, see the [documentation with git](https://git-scm.com/docs/git-rebase).
127127

128128
To do it, let's go back to `main` and rebase from `contractors`:
129129

@@ -156,7 +156,7 @@ Date: 2021-10-15 11:54:21
156156

157157
## Reset, time traveling machine
158158

159-
Time fries, now the project is done and the contractors has done their jobs and left the company. We have to time travel to the state of the company before the project.
159+
Time flies, now the project is done and the contractors have done their jobs and left the company. We have to time travel to the state of the company before the project.
160160

161161
Let's verify our log again:
162162

@@ -184,7 +184,7 @@ Date: 2021-10-15 11:48:32
184184
185185
```
186186

187-
We would like to keep the commits up to the `Adding Ethan` one, take note of the commit id of that commit. Mine is `8o4vkomwryjogg37u3abojflpzrt0r4`, yours will be different.
187+
We would like to keep the commits up to the `Adding Ethan` one, take note of the commit id for that commit. Mine is `8o4vkomwryjogg37u3abojflpzrt0r4`, yours will be different.
188188

189189
To reset, we use the `tdbpy reset` command:
190190

@@ -193,7 +193,7 @@ $ tdbpy reset 8o4vkomwryjogg37u3abojflpzrt0r4
193193
Hard reset to commit 8o4vkomwryjogg37u3abojflpzrt0r4
194194
```
195195

196-
Notice that it is a hard reset, meaning that the changes after the commit `Adding Ethan` is gone forever! If you are not sure or just want to temporary reset to a previous time, make sure you use `--soft` option. Now let's have a look at the log again:
196+
Notice that it is a hard reset, meaning that the changes after the commit `Adding Ethan` is gone forever! If you are not sure or just want to temporary reset to a previous time, make sure to use `--soft` option. Now let's have a look at the log again:
197197

198198
```
199199
$ tdbpy log
@@ -213,8 +213,8 @@ Date: 2021-10-15 11:48:32
213213
214214
```
215215

216-
We are back to where we were again.
216+
We are back to where we were once more.
217217

218218
---
219219

220-
[Move on to Lesson 7 - Logical query using triple and WOQL](lesson_7.md)
220+
[Lesson 7 - Logical query using triple and WOQL](lesson_7.md)

0 commit comments

Comments
 (0)