about summary refs log tree commit diff
path: root/usth/ICT2.7/P1L4 Version Control Subtitles
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2020-07-19 20:34:40 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2020-07-19 20:34:40 +0700
commit8a7dfa0972c83fd811a4296e7373574bea4a28d0 (patch)
tree16d37247e8b909ce5f885affd2b2473faab891fd /usth/ICT2.7/P1L4 Version Control Subtitles
parentdc6f57c3af35f599abab2c4bac950654282cb519 (diff)
downloadcp-8a7dfa0972c83fd811a4296e7373574bea4a28d0.tar.gz
[usth/ICT2.7] Remove Udacity transcribes
Diffstat (limited to 'usth/ICT2.7/P1L4 Version Control Subtitles')
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/1 - Lesson Overview - lang_en_vs5.srt43
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/10 - Introduction to GIT - lang_en_vs6.srt79
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/11 - Installing GIT - lang_en_vs5.srt63
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/12 - GIT Workflow - lang_en_vs5.srt507
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/13 - GIT Demo: Intro to Git - lang_en_vs5.srt1095
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/14 - GIT Demo: Git + Eclipse - lang_en_vs5.srt307
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/15 - GIT Demo: Github - lang_en_vs3.srt239
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/16 - GIT Recap - lang_en_vs5.srt35
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/17 - GIT Recap: Local Repositories - lang_en_vs5.srt163
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/18 - GIT Recap: Remote Repositories - lang_en_vs3.srt59
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/19 - GitHub Setup Assignment - lang_en_vs2.srt15
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/19 - GitHub Setup Assignment - lang_pt_vs1.srt19
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/2 - Interview with John Britton - lang_en_vs5.srt435
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/3 - Version Control System Introduction - lang_en_vs5.srt207
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/4 - VCS Quiz - lang_en_vs4.srt31
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/5 - VCS Quiz Solution - lang_en_vs7.srt11
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/6 - Essential Actions - lang_en_vs5.srt79
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/7 - Example Workflow - lang_en_vs5.srt111
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/8 - "Don'ts" in VCS - lang_en_vs5.srt175
-rw-r--r--usth/ICT2.7/P1L4 Version Control Subtitles/9 - Two Main Types of VCS - lang_en_vs5.srt163
20 files changed, 0 insertions, 3836 deletions
diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/1 - Lesson Overview - lang_en_vs5.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/1 - Lesson Overview - lang_en_vs5.srt
deleted file mode 100644
index 936e3db..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/1 - Lesson Overview - lang_en_vs5.srt
+++ /dev/null
@@ -1,43 +0,0 @@
-1

-00:00:00,440 --> 00:00:06,190

-Hi and welcome to the second lesson on tools of the trade. In the

-

-2

-00:00:06,190 --> 00:00:09,710

-previous lesson we talked about IDEs. Integrated

-

-3

-00:00:09,710 --> 00:00:13,300

-Development Environments and in particular we discussed

-

-4

-00:00:13,300 --> 00:00:16,460

-the eclipse ID. Today we're going to

-

-5

-00:00:16,460 --> 00:00:19,780

-talk about another fundamental type of tools

-

-6

-00:00:19,780 --> 00:00:22,840

-in the software engineering arena. Version control

-

-7

-00:00:22,840 --> 00:00:26,140

-systems. And these are also called, revision

-

-8

-00:00:26,140 --> 00:00:30,620

-or source control systems. In particular, we will focus on a

-

-9

-00:00:30,620 --> 00:00:36,320

-specific version control system called git. And as we did for eclipse,

-

-10

-00:00:36,320 --> 00:00:40,510

-we will first present git from a conceptual standpoint. And then

-

-11

-00:00:40,510 --> 00:00:44,200

-we will do a demo. To get some hands-on experience with GIT.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/10 - Introduction to GIT - lang_en_vs6.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/10 - Introduction to GIT - lang_en_vs6.srt
deleted file mode 100644
index 201c7a5..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/10 - Introduction to GIT - lang_en_vs6.srt
+++ /dev/null
@@ -1,79 +0,0 @@
-1

-00:00:00,240 --> 00:00:04,160

-One good representative of distributed version control systems, is

-

-2

-00:00:04,160 --> 00:00:08,320

-GIT. A distributed version control system that was initially designed

-

-3

-00:00:08,320 --> 00:00:11,297

-and developed by Linus Torvalds. I'm pretty sure you

-

-4

-00:00:11,297 --> 00:00:14,140

-know who Linus Torvalds is. He's basically this guy who

-

-5

-00:00:14,140 --> 00:00:17,070

-started and created the Linux operating system. And Linus

-

-6

-00:00:17,070 --> 00:00:20,140

-was unhappy with the existing version control systems, and wanted

-

-7

-00:00:20,140 --> 00:00:22,610

-a different one. He wanted to use it for maintaining

-

-8

-00:00:22,610 --> 00:00:25,330

-the Linux kernel. In particular, he wanted one with some

-

-9

-00:00:25,330 --> 00:00:28,550

-key characteristics. For example, the fact that it was distributed. He

-

-10

-00:00:28,550 --> 00:00:30,470

-wanted it to be fast. He wanted it to have a

-

-11

-00:00:30,470 --> 00:00:33,660

-simple design. And he wanted to have a strong support for

-

-12

-00:00:33,660 --> 00:00:37,370

-parallel branches, because many people were contributing to the kernel at the

-

-13

-00:00:37,370 --> 00:00:41,620

-same time. And therefore there many different branches of development. And

-

-14

-00:00:41,620 --> 00:00:45,120

-finally, he wanted for the virtual control system to be able to

-

-15

-00:00:45,120 --> 00:00:48,070

-handle large projects. As the Linux kernel is, and to do

-

-16

-00:00:48,070 --> 00:00:50,480

-it in an efficient way. So if you want to get an idea

-

-17

-00:00:50,480 --> 00:00:54,210

-of how popular GIT is today, there was a survey performed across the

-

-18

-00:00:54,210 --> 00:00:58,330

-Eclipse IDE users, and it showed that in 2013 GIT was used by

-

-19

-00:00:58,330 --> 00:01:02,950

-about 30% of the developers. So the, it had a 30% adoption rate.

-

-20

-00:01:02,950 --> 00:01:06,430

-So we will use a GIT as a version control system for the class.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/11 - Installing GIT - lang_en_vs5.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/11 - Installing GIT - lang_en_vs5.srt
deleted file mode 100644
index 38eedc0..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/11 - Installing GIT - lang_en_vs5.srt
+++ /dev/null
@@ -1,63 +0,0 @@
-1

-00:00:00,120 --> 00:00:03,020

-As we did for Eclipse, and IDEs in general, we want

-

-2

-00:00:03,020 --> 00:00:05,133

-to start a GIT in a hands on way. So we're going

-

-3

-00:00:05,133 --> 00:00:08,425

-to start by seeing how to install GIT. And GIT is also

-

-4

-00:00:08,425 --> 00:00:12,440

-multiplatform, so you can install it no matter what operating system you

-

-5

-00:00:12,440 --> 00:00:15,980

-are using, unless of course you are using some arcane operating system.

-

-6

-00:00:15,980 --> 00:00:18,530

-But if you are using Linux, for instance, there should be a

-

-7

-00:00:18,530 --> 00:00:22,608

-package available that can install GIT for your specific distribution. If you're

-

-8

-00:00:22,608 --> 00:00:25,460

-using Mac OS, GIT is also available as part of XCode and

-

-9

-00:00:25,460 --> 00:00:29,270

-also as an independent package. Finally, if you're using Windows, GIT is

-

-10

-00:00:29,270 --> 00:00:33,090

-available as a package with an installer. In general, you can go

-

-11

-00:00:33,090 --> 00:00:37,290

-here to get information about how to get GIT, where to download

-

-12

-00:00:37,290 --> 00:00:39,975

-it, how to install it, and so on. So, now what I'd

-

-13

-00:00:39,975 --> 00:00:42,312

-like for you to do is to go, get GIT, install it,

-

-14

-00:00:42,312 --> 00:00:45,469

-in case you don't have it installed already on your machine. And

-

-15

-00:00:45,469 --> 00:00:48,253

-after that, you should be able to run GIT from the command

-

-16

-00:00:48,253 --> 00:00:51,120

-line. And, that's exactly what we're going to do through a demo.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/12 - GIT Workflow - lang_en_vs5.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/12 - GIT Workflow - lang_en_vs5.srt
deleted file mode 100644
index 84f0f2e..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/12 - GIT Workflow - lang_en_vs5.srt
+++ /dev/null
@@ -1,507 +0,0 @@
-1

-00:00:00,070 --> 00:00:02,100

-But before jumping into the demo I would like

-

-2

-00:00:02,100 --> 00:00:05,370

-to give a high level overview of the GIT workflow,

-

-3

-00:00:05,370 --> 00:00:08,420

-which will help you better, following the demo. So let

-

-4

-00:00:08,420 --> 00:00:12,480

-me start by representing four fundamental elements in the GIT

-

-5

-00:00:12,480 --> 00:00:15,640

-workflow which are these four: the workspace which is your

-

-6

-00:00:15,640 --> 00:00:19,980

-local directory. The index, also called the stage, and we'll

-

-7

-00:00:19,980 --> 00:00:22,470

-see in a minute what the index is. Then, we

-

-8

-00:00:22,470 --> 00:00:25,380

-have the local repository. We'll also refer to this as

-

-9

-00:00:25,380 --> 00:00:27,910

-HEAD in the, when we explain the different commands

-

-10

-00:00:27,910 --> 00:00:31,340

-and then, the word flow. And finally, the remote repository.

-

-11

-00:00:31,340 --> 00:00:34,600

-If you consider a file in your work space it

-

-12

-00:00:34,600 --> 00:00:37,860

-can be in three possible states. It can be committed

-

-13

-00:00:37,860 --> 00:00:40,170

-which means that the data, the latest changes to the

-

-14

-00:00:40,170 --> 00:00:45,030

-file are safely stored here. It could be modified, which

-

-15

-00:00:45,030 --> 00:00:47,840

-is the case of the file being changed and no,

-

-16

-00:00:47,840 --> 00:00:50,710

-none of these changes being saved to the local repository

-

-17

-00:00:50,710 --> 00:00:54,440

-so locally modified or it can be staged. And

-

-18

-00:00:54,440 --> 00:00:58,270

-stage means that the file is basically part of this

-

-19

-00:00:58,270 --> 00:01:01,620

-index. And what that means, that it's been tagged

-

-20

-00:01:01,620 --> 00:01:04,890

-to be considered in the next commit. And I know

-

-21

-00:01:04,890 --> 00:01:08,070

-that this is not all 100% intuitive, so let's

-

-22

-00:01:08,070 --> 00:01:10,860

-look at that again by considering the actual workflow and

-

-23

-00:01:10,860 --> 00:01:12,680

-let's see what happens when you issue the different

-

-24

-00:01:12,680 --> 00:01:16,060

-commands in git. So the first command that you normally

-

-25

-00:01:16,060 --> 00:01:18,520

-run in case you, you're getting access to a remote

-

-26

-00:01:18,520 --> 00:01:21,940

-repository, is the git clone command. And the git clone,

-

-27

-00:01:21,940 --> 00:01:24,880

-followed by the url for that repository, will create a

-

-28

-00:01:24,880 --> 00:01:28,580

-local copy of the repository in your workspace. And of

-

-29

-00:01:28,580 --> 00:01:30,310

-course, you don't have to do this step if you're

-

-30

-00:01:30,310 --> 00:01:34,380

-creating the repository yourself. The next command that we already

-

-31

-00:01:34,380 --> 00:01:38,170

-saw is the command add. And what the command add

-

-32

-00:01:38,170 --> 00:01:41,130

-does is to add a file that is in the

-

-33

-00:01:41,130 --> 00:01:44,630

-workspace to this index. And we say that after that, the

-

-34

-00:01:44,630 --> 00:01:48,700

-file is staged. So it's marked to be committed, but not

-

-35

-00:01:48,700 --> 00:01:53,350

-yet committed. And here I'm just mentioning this minus u option.

-

-36

-00:01:53,350 --> 00:01:56,330

-If you specify the minus u option, you will also consider deleted

-

-37

-00:01:56,330 --> 00:01:58,820

-files File, but let's not get there for now, we'll talk

-

-38

-00:01:58,820 --> 00:02:01,240

-about that when we do the demo. As I said, if you

-

-39

-00:02:01,240 --> 00:02:03,720

-add the file, it just gets added to this index but

-

-40

-00:02:03,720 --> 00:02:06,430

-is not actually committed, so what you need to do, is to

-

-41

-00:02:06,430 --> 00:02:10,389

-commit the file, so when you execute git commit, all the

-

-42

-00:02:10,389 --> 00:02:13,970

-files that are staged, that are released it here, their changes

-

-43

-00:02:13,970 --> 00:02:17,080

-will be committed to the local repository. So your files, as

-

-44

-00:02:17,080 --> 00:02:18,970

-I was saying, they can be in three states. They will

-

-45

-00:02:18,970 --> 00:02:21,820

-go from the modified state to the stage state when you

-

-46

-00:02:21,820 --> 00:02:24,200

-execute the app. And then from the stage state to the

-

-47

-00:02:24,200 --> 00:02:27,510

-committed state when you perform a GIT Commit. Okay, so at

-

-48

-00:02:27,510 --> 00:02:31,780

-this point your changes are safely stored in the local repository.

-

-49

-00:02:31,780 --> 00:02:34,370

-Notice that you can also perform these two steps at

-

-50

-00:02:34,370 --> 00:02:38,150

-once by executing a Commit -a. So if you have

-

-51

-00:02:38,150 --> 00:02:40,920

-a set of modified files, and all these files are

-

-52

-00:02:40,920 --> 00:02:44,550

-already part of the repository, so they're already known to diversion

-

-53

-00:02:44,550 --> 00:02:47,540

-control system, you can simply execute a commit -a.

-

-54

-00:02:47,540 --> 00:02:50,040

-And what the commit -a command will do, it

-

-55

-00:02:50,040 --> 00:02:53,080

-will stage your file and then commit them. All at

-

-56

-00:02:53,080 --> 00:02:56,650

-once. So it's a convenient shortcut. Of course, as I said,

-

-57

-00:02:56,650 --> 00:02:58,710

-this will not work if the file is a new file.

-

-58

-00:02:58,710 --> 00:03:00,730

-So if a file is a new file, you have to manually add

-

-59

-00:03:00,730 --> 00:03:04,620

-it. Otherwise commit -a will just stage and commit at once.

-

-60

-00:03:04,620 --> 00:03:07,400

-As we discussed when we looked at the diffence between centralized

-

-61

-00:03:07,400 --> 00:03:10,520

-and decentralized version console system. We saw that in the case

-

-62

-00:03:10,520 --> 00:03:13,930

-of the decentralized, there is a local repository which is this one.

-

-63

-00:03:13,930 --> 00:03:17,190

-And then you have to explicitly push your changes to a remote

-

-64

-00:03:17,190 --> 00:03:21,850

-repository, and this is exactly what the git push command does. It pushes

-

-65

-00:03:21,850 --> 00:03:25,930

-your changes that are in the local repository to the remote repository

-

-66

-00:03:25,930 --> 00:03:28,160

-so at this point all of your changes will be

-

-67

-00:03:28,160 --> 00:03:31,680

-visible to anyone who has access to the remote repository.

-

-68

-00:03:31,680 --> 00:03:33,710

-Now, let's see the opposite flow so how does it

-

-69

-00:03:33,710 --> 00:03:36,640

-work when you're actually getting files from the repository instead

-

-70

-00:03:36,640 --> 00:03:39,650

-of committing files to the repository. So the first command

-

-71

-00:03:39,650 --> 00:03:43,280

-I want to mention is the get fetch command and

-

-72

-00:03:43,280 --> 00:03:46,900

-what the get fetch command does is to get files from

-

-73

-00:03:46,900 --> 00:03:50,680

-the remote repositories to your local repository, but not yet to

-

-74

-00:03:50,680 --> 00:03:53,890

-your working directory. And we will see what is the usefullness of

-

-75

-00:03:53,890 --> 00:03:56,900

-doing this operation. Of having the files all in the local respository,

-

-76

-00:03:56,900 --> 00:03:59,380

-but not in your local directory. So, what that means, just to

-

-77

-00:03:59,380 --> 00:04:01,360

-make sure that we're on the same page. Is that you

-

-78

-00:04:01,360 --> 00:04:05,620

-will not see these files when you workspace. You will still have

-

-79

-00:04:05,620 --> 00:04:09,030

-your local files here. So this is sort of a physical distinction.

-

-80

-00:04:09,030 --> 00:04:12,060

-In order to get your data files from the local repositories to

-

-81

-00:04:12,060 --> 00:04:14,470

-your workspace you have to issue another command. Which is

-

-82

-00:04:14,470 --> 00:04:18,250

-the command git merge. Git merge will take the changes in

-

-83

-00:04:18,250 --> 00:04:21,870

-local repository and get them to your local workspace. So at

-

-84

-00:04:21,870 --> 00:04:25,460

-this point your files will be updated. To what is in

-

-85

-00:04:25,460 --> 00:04:27,730

-the remote reposity. Or at least what was in the

-

-86

-00:04:27,730 --> 00:04:30,810

-remote reposity at the time of the fetch. SImilarly to what

-

-87

-00:04:30,810 --> 00:04:34,340

-happened for the add and commit. There's a shortcut which is

-

-88

-00:04:34,340 --> 00:04:37,230

-the command git pull. So in case you want to get

-

-89

-00:04:37,230 --> 00:04:40,590

-the changes directly. To your work space with a single

-

-90

-00:04:40,590 --> 00:04:44,120

-command, you can issue a git pull command and what will

-

-91

-00:04:44,120 --> 00:04:46,560

-happen, is that the changes will get collected from the

-

-92

-00:04:46,560 --> 00:04:49,810

-remote repository and they will go to your local repository and

-

-93

-00:04:49,810 --> 00:04:51,990

-to your work space, at once. So this has the

-

-94

-00:04:51,990 --> 00:04:55,820

-same affect as performing a git fetch and a git merge.

-

-95

-00:04:55,820 --> 00:04:59,160

-So if we can do everything in one command, why,

-

-96

-00:04:59,160 --> 00:05:03,290

-why we want to fetch and berch as two separate operations?

-

-97

-00:05:03,290 --> 00:05:05,920

-So one of the reason is because this allows us

-

-98

-00:05:05,920 --> 00:05:09,410

-to compare files before we actually get the latest version

-

-99

-00:05:09,410 --> 00:05:12,600

-of the files. In particular, I can run the command

-

-100

-00:05:12,600 --> 00:05:17,310

-git diff head to get the difference between my local files,

-

-101

-00:05:17,310 --> 00:05:20,330

-the files in my working directory, and the files in

-

-102

-00:05:20,330 --> 00:05:22,800

-my local repository. So what I can do, I can

-

-103

-00:05:22,800 --> 00:05:25,550

-fetch the files from the remote repository, and once I

-

-104

-00:05:25,550 --> 00:05:29,260

-fetch these files. I can run a git diff head and

-

-105

-00:05:29,260 --> 00:05:32,620

-check what the differences are. And based on the differences decide

-

-106

-00:05:32,620 --> 00:05:35,554

-whether I want to merge or not. So while we are talking about

-

-107

-00:05:35,554 --> 00:05:37,890

-git diff, there is something else that you can use with the

-

-108

-00:05:37,890 --> 00:05:41,060

-diff command. So what you can do, you can run git diff

-

-109

-00:05:41,060 --> 00:05:44,930

-without further specifying head. In this case, what the command tell you

-

-110

-00:05:44,930 --> 00:05:48,310

-is the difference between the files that you have in your work

-

-111

-00:05:48,310 --> 00:05:51,780

-space and the ones that are staged for a commit. So basically,

-

-112

-00:05:51,780 --> 00:05:54,630

-what it will be telling you, is that what you could still

-

-113

-00:05:54,630 --> 00:05:58,300

-add to the stage for the further commit, and that you

-

-114

-00:05:58,300 --> 00:06:01,230

-haven't already. So what local changes will not make it to the

-

-115

-00:06:01,230 --> 00:06:04,440

-next commit, basically. And this you can use, for example, as

-

-116

-00:06:04,440 --> 00:06:07,450

-a sanity check before doing a commit to make sure all the

-

-117

-00:06:07,450 --> 00:06:09,980

-local changes that you have, and that you want to commit,

-

-118

-00:06:09,980 --> 00:06:13,230

-are actually staged and therefore will be considered. So now we will

-

-119

-00:06:13,230 --> 00:06:16,930

-cover all of the commands that we saw here. In our practical

-

-120

-00:06:16,930 --> 00:06:20,560

-demo. But please feel free to refer back to this Git Workflow

-

-121

-00:06:20,560 --> 00:06:23,570

-to get a kind of a high level vision. Or maybe you want to keep it next to

-

-122

-00:06:23,570 --> 00:06:26,110

-you, because this really gives you the overall structure

-

-123

-00:06:26,110 --> 00:06:28,450

-and the overall view of what happens when you

-

-124

-00:06:28,450 --> 00:06:31,160

-run the different commands. And it also helps you

-

-125

-00:06:31,160 --> 00:06:34,840

-visualize The different elements that are relevant when you're

-

-126

-00:06:34,840 --> 00:06:37,970

-using GIT. So the workspace, once more, the index

-

-127

-00:06:37,970 --> 00:06:40,790

-or stage, the local repository, and the remote repository.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/13 - GIT Demo: Intro to Git - lang_en_vs5.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/13 - GIT Demo: Intro to Git - lang_en_vs5.srt
deleted file mode 100644
index d3b3a24..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/13 - GIT Demo: Intro to Git - lang_en_vs5.srt
+++ /dev/null
@@ -1,1095 +0,0 @@
-1

-00:00:00,120 --> 00:00:02,170

-In this first part of the git demo, we will

-

-2

-00:00:02,170 --> 00:00:05,080

-call it the basics of git. So for example, how to

-

-3

-00:00:05,080 --> 00:00:08,280

-introduce yourself to git, how to create a repository, how to

-

-4

-00:00:08,280 --> 00:00:12,450

-commit changes and get changes from the repository, and so on.

-

-5

-00:00:12,450 --> 00:00:15,140

-So after you installed git you should have the git tool

-

-6

-00:00:15,140 --> 00:00:18,150

-available on the command line, so you can run the command

-

-7

-00:00:18,150 --> 00:00:21,110

-git and, if you just execute git you will get the

-

-8

-00:00:21,110 --> 00:00:25,930

-usage information for git, with the most commonly used git commands.

-

-9

-00:00:25,930 --> 00:00:28,940

-And to find information on any command, you can simply

-

-10

-00:00:28,940 --> 00:00:32,310

-type git help and the name of the command. For

-

-11

-00:00:32,310 --> 00:00:35,240

-example, lets try to write git help init. And that

-

-12

-00:00:35,240 --> 00:00:38,960

-brings up the git manual page for git init, which describes

-

-13

-00:00:38,960 --> 00:00:41,590

-the command, the synopsis, and so on. Now, lets get

-

-14

-00:00:41,590 --> 00:00:45,970

-started with using git by introducing ourselves to git, which is

-

-15

-00:00:45,970 --> 00:00:47,830

-the first thing we need to do. To do that

-

-16

-00:00:47,830 --> 00:00:51,310

-we use the git config command, in particular we are going to

-

-17

-00:00:51,310 --> 00:00:54,170

-write to the git config minus, minus global

-

-18

-00:00:54,170 --> 00:00:56,440

-user dot name. Which means we are telling it

-

-19

-00:00:56,440 --> 00:00:59,900

-our user name. We'll specify our user name which

-

-20

-00:00:59,900 --> 00:01:02,970

-in this case is George P. Burdell. You could

-

-21

-00:01:02,970 --> 00:01:04,970

-also provide your email address in the same

-

-22

-00:01:04,970 --> 00:01:09,370

-way. So you still use the git config --global

-

-23

-00:01:09,370 --> 00:01:12,750

-command. But in this case you will write user.email

-

-24

-00:01:12,750 --> 00:01:16,580

-as the property. And then you'll specify a suitable

-

-25

-00:01:16,580 --> 00:01:19,670

-email address. In this case, the email address of George P.

-

-26

-00:01:19,670 --> 00:01:23,780

-Burdell. We will now look at some commonly used commands that to

-

-27

-00:01:23,780 --> 00:01:27,210

-create and maintain a local repository. Let's first create a

-

-28

-00:01:27,210 --> 00:01:30,510

-new project and call it my project. So, to do that we

-

-29

-00:01:30,510 --> 00:01:32,790

-are simply going to create a directory and then we're going

-

-30

-00:01:32,790 --> 00:01:35,520

-to move into that directory. Now, if we try to call the

-

-31

-00:01:35,520 --> 00:01:39,000

-git status command at this point to see what's the state of

-

-32

-00:01:39,000 --> 00:01:41,990

-my project, of course git doesn't know anything about this project, right?

-

-33

-00:01:41,990 --> 00:01:44,360

-So, you will get an error. It will tell you that, basically,

-

-34

-00:01:44,360 --> 00:01:47,080

-we're not in a git repository. So how do we create a git

-

-35

-00:01:47,080 --> 00:01:50,090

-repository? How do we make this? A Git repository, but we do it

-

-36

-00:01:50,090 --> 00:01:53,560

-by calling git init and the output will tell you that the

-

-37

-00:01:53,560 --> 00:01:56,580

-repository was initialized. If we check the status again, you will see

-

-38

-00:01:56,580 --> 00:01:59,790

-that now Git recognizes the repository and will tell you that there is

-

-39

-00:01:59,790 --> 00:02:01,160

-nothing to commit because, of course,

-

-40

-00:02:01,160 --> 00:02:03,190

-the repository is completely empty. So let's

-

-41

-00:02:03,190 --> 00:02:07,380

-just create a new, empty file. Which we're going to call REAME. So

-

-42

-00:02:07,380 --> 00:02:10,008

-now if you run git status, as you can see, git will

-

-43

-00:02:10,008 --> 00:02:13,250

-tell you there is a file that's called README, but it's untracked.

-

-44

-00:02:13,250 --> 00:02:15,600

-Now what that means is that the file not staged, if you

-

-45

-00:02:15,600 --> 00:02:18,710

-remember our lesson. So what we need to do, we first need

-

-46

-00:02:18,710 --> 00:02:22,040

-to tell git that, you know, this needs to be considered. And

-

-47

-00:02:22,040 --> 00:02:25,690

-the way we do that, is by calling the git at command

-

-48

-00:02:25,690 --> 00:02:28,880

-and then we specify README as the argument for the command. If

-

-49

-00:02:28,880 --> 00:02:33,090

-we call again, Git status. Now, as you can see, Git knows

-

-50

-00:02:33,090 --> 00:02:35,780

-that there is a new file called README, because the file

-

-51

-00:02:35,780 --> 00:02:38,390

-is staged. So Git is aware of the fact that this

-

-52

-00:02:38,390 --> 00:02:41,490

-file has to be committed. So, to commit a file,

-

-53

-00:02:41,490 --> 00:02:45,410

-we simply execute git commit, which will open a text editor, which

-

-54

-00:02:45,410 --> 00:02:48,500

-can be different, depending on what is your environment, and here

-

-55

-00:02:48,500 --> 00:02:50,980

-we need to add a comment to be added to the commit.

-

-56

-00:02:50,980 --> 00:02:54,760

-So here we simply write in Added README file, then we

-

-57

-00:02:54,760 --> 00:02:58,170

-can close and save And this will add the file to the

-

-58

-00:02:58,170 --> 00:03:01,310

-Git repository. The local Git repository of course. At this

-

-59

-00:03:01,310 --> 00:03:04,220

-point, if we ran Git status again to see where we are.

-

-60

-00:03:04,220 --> 00:03:06,400

-You can see that Git tells you that there is nothing

-

-61

-00:03:06,400 --> 00:03:08,660

-to commit. Because of course the only file that we have, is

-

-62

-00:03:08,660 --> 00:03:13,070

-committed to the repository. Now, let's make some changes to our

-

-63

-00:03:13,070 --> 00:03:17,270

-README file. I'm just going to add some text here. Once more, we

-

-64

-00:03:17,270 --> 00:03:20,050

-can run git status, and at this point, git knows about

-

-65

-00:03:20,050 --> 00:03:23,430

-this file. So, it will know that README file has been modified.

-

-66

-00:03:23,430 --> 00:03:25,280

-Remember that before, it was telling you that it was a new

-

-67

-00:03:25,280 --> 00:03:28,310

-file, now it knows that there was a different version in the

-

-68

-00:03:28,310 --> 00:03:31,430

-repository. So something we can do, at this point, for example, is

-

-69

-00:03:31,430 --> 00:03:34,820

-to check the differences. Between this file and the committed one by

-

-70

-00:03:34,820 --> 00:03:38,040

-executing get diff readme and if you look at the output of

-

-71

-00:03:38,040 --> 00:03:42,320

-the get diff command here, you can see that this line, readme

-

-72

-00:03:42,320 --> 00:03:45,170

-file content was added and you'll see that it was added because

-

-73

-00:03:45,170 --> 00:03:48,610

-there's a plus sign before that line. In case of deletion of lines,

-

-74

-00:03:48,610 --> 00:03:51,460

-you'll see a minusm sign there. So at this point, if we

-

-75

-00:03:51,460 --> 00:03:54,950

-want to commit our file, remember that we'll always have to tell git

-

-76

-00:03:54,950 --> 00:03:58,070

-that we want to stage the file before committing it. Otherwise, it

-

-77

-00:03:58,070 --> 00:04:01,420

-will be ignored by the commit operation. So to tell git, that the

-

-78

-00:04:01,420 --> 00:04:04,140

-file has to be staged, we will, can use the usual git

-

-79

-00:04:04,140 --> 00:04:07,140

-add command. But if you remember the lesson, we can also use a

-

-80

-00:04:07,140 --> 00:04:10,150

-shortcut. So you, we don't really have to do this in two steps.

-

-81

-00:04:10,150 --> 00:04:13,730

-We can simply say, git commit -a, and this will tell git to

-

-82

-00:04:13,730 --> 00:04:17,120

-commit all of the files that git knows about, which in this

-

-83

-00:04:17,120 --> 00:04:19,959

-case is only the written file of course. Something else that we can

-

-84

-00:04:19,959 --> 00:04:22,950

-do, is that we can also provide the right away message for

-

-85

-00:04:22,950 --> 00:04:26,140

-the commit, without having to open an editor. So, to do that we

-

-86

-00:04:26,140 --> 00:04:29,760

-can specify the -n option. And at this point a we can

-

-87

-00:04:29,760 --> 00:04:34,050

-just put a in double quotes our content we press enter and as

-

-88

-00:04:34,050 --> 00:04:36,690

-you can see it will notify us that one file was changed

-

-89

-00:04:36,690 --> 00:04:38,850

-and in particular it will also tell you that there was an a

-

-90

-00:04:38,850 --> 00:04:41,470

-insertion again if we run git status you will see that

-

-91

-00:04:41,470 --> 00:04:44,800

-there is nothing else to commit. So now lets imagine that

-

-92

-00:04:44,800 --> 00:04:48,390

-you want to see the version history for your repository. You

-

-93

-00:04:48,390 --> 00:04:51,760

-can do that by running the git log command. So if

-

-94

-00:04:51,760 --> 00:04:54,560

-you run that, it will show you all the different commits

-

-95

-00:04:54,560 --> 00:04:57,990

-For your repository. And each commit has got a commit ID, as

-

-96

-00:04:57,990 --> 00:05:01,010

-you can see here and the one down here is

-

-97

-00:05:01,010 --> 00:05:04,740

-the first commit, where as the one above is the second commit.

-

-98

-00:05:04,740 --> 00:05:07,670

-And as you can see, we'll also show you the comments associated

-

-99

-00:05:07,670 --> 00:05:11,070

-with each commit. And in case you wanted to see the changes introduced

-

-100

-00:05:11,070 --> 00:05:14,500

-by a commit. You can use that git show command, and you

-

-101

-00:05:14,500 --> 00:05:18,220

-can provide the commit ID for the commit that you're interested in.

-

-102

-00:05:18,220 --> 00:05:20,600

-And you don't really need to provide the whole ID, you can

-

-103

-00:05:20,600 --> 00:05:23,600

-provide the first four or more characters. So that's what we're going to

-

-104

-00:05:23,600 --> 00:05:26,540

-do here. So we're going to specify the second commit, and when we

-

-105

-00:05:26,540 --> 00:05:31,120

-execute the command it will show use the changes introduced by that commit.

-

-106

-00:05:31,120 --> 00:05:33,550

-To fetch a repository from a remote server, you can

-

-107

-00:05:33,550 --> 00:05:36,350

-use the git clone command. So you will write git clone

-

-108

-00:05:36,350 --> 00:05:39,140

-and then specify the URL. For the remote repository. Here

-

-109

-00:05:39,140 --> 00:05:44,260

-we are using the SSH protocal and there are different protocals

-

-110

-00:05:44,260 --> 00:05:46,680

-that can be used, so the remote repository can be

-

-111

-00:05:46,680 --> 00:05:49,800

-made available in different ways. As you can see, when you

-

-112

-00:05:49,800 --> 00:05:54,050

-clone the project, the project is cloned into the local directory.

-

-113

-00:05:54,050 --> 00:05:57,180

-If you wanted to import the project under a different name.

-

-114

-00:05:57,180 --> 00:05:59,790

-You could just specify the name that you want for the

-

-115

-00:05:59,790 --> 00:06:03,110

-Local Directory. For example, in this case, myproject2. And,

-

-116

-00:06:03,110 --> 00:06:06,630

-so here you'll get the project in my local work space

-

-117

-00:06:06,630 --> 00:06:09,530

-with the name that I specified. So, let's go inside one

-

-118

-00:06:09,530 --> 00:06:12,020

-of these two projects that have the same content because they're

-

-119

-00:06:12,020 --> 00:06:14,930

-coming from the repository. If you want to see the details

-

-120

-00:06:14,930 --> 00:06:18,550

-of the server you can use the remote command and specify

-

-121

-00:06:18,550 --> 00:06:22,230

-the flag -v. And here we'll show you what is the remote

-

-122

-00:06:22,230 --> 00:06:25,560

-repository now let's go ahead to make some changes to the project

-

-123

-00:06:25,560 --> 00:06:28,820

-for example let's add a file. So I'm just going to create this

-

-124

-00:06:28,820 --> 00:06:31,230

-empty file which I am going to call new file I'm going to

-

-125

-00:06:31,230 --> 00:06:34,890

-add it to my index so that it gets committed. Later on and

-

-126

-00:06:34,890 --> 00:06:37,650

-then I'm going to run git commit to actually commit it to the

-

-127

-00:06:37,650 --> 00:06:41,570

-local repository. And I'm going to specify the comment for the commit right

-

-128

-00:06:41,570 --> 00:06:44,120

-away here from the command line. So when we do that the

-

-129

-00:06:44,120 --> 00:06:47,680

-file gets added to my local repository. And if we want to double

-

-130

-00:06:47,680 --> 00:06:50,690

-check that, we can run git log. And if you look at

-

-131

-00:06:50,690 --> 00:06:53,360

-the last commit at the top, you can see that it's telling

-

-132

-00:06:53,360 --> 00:06:56,980

-me that the new file was added to the repository, showing the

-

-133

-00:06:56,980 --> 00:06:59,940

-comment that I added. But this is just for the local repository,

-

-134

-00:06:59,940 --> 00:07:03,100

-so I need to use the git push command to push it

-

-135

-00:07:03,100 --> 00:07:06,250

-to the remote repository. And at this point, when I run that,

-

-136

-00:07:06,250 --> 00:07:09,890

-my local changes will be committed. To the remote repository. So now

-

-137

-00:07:09,890 --> 00:07:13,110

-let's go to the other copy of the project that we created.

-

-138

-00:07:13,110 --> 00:07:16,660

-The one under directory myproject2. If you remember this project was

-

-139

-00:07:16,660 --> 00:07:19,610

-linked up to the same remote project. But of course, if we run

-

-140

-00:07:19,610 --> 00:07:22,720

-get log here, we don't see this latest change that we made, because

-

-141

-00:07:22,720 --> 00:07:25,970

-we didn't synchronize this local copy with the remote copy. And so we

-

-142

-00:07:25,970 --> 00:07:28,530

-just have these files, the README and ,Five that worked there before.

-

-143

-00:07:28,530 --> 00:07:30,720

-So what we need to do is that we need to pull the

-

-144

-00:07:30,720 --> 00:07:34,180

-changes from the remote repository using git pull, and when we do that,

-

-145

-00:07:34,180 --> 00:07:38,130

-that will actually pull these changes and therefore, create the new files that

-

-146

-00:07:38,130 --> 00:07:41,340

-we created in the other directory. And if we run git log now,

-

-147

-00:07:41,340 --> 00:07:43,790

-you can see that now we have the new entry. The comment at

-

-148

-00:07:43,790 --> 00:07:46,920

-the top, that says this new file was added and of course, this

-

-149

-00:07:46,920 --> 00:07:49,880

-is just an example, so we had two copies of the project on the

-

-150

-00:07:49,880 --> 00:07:52,990

-same machine and for the same user, so the normal users scenario for

-

-151

-00:07:52,990 --> 00:07:56,230

-this, it will be that, each user will have their local copy, but this

-

-152

-00:07:56,230 --> 00:07:59,220

-should have given you the idea of how, git allows you to work

-

-153

-00:07:59,220 --> 00:08:03,210

-on some local file. Commit them and push them to a remote repository and

-

-154

-00:08:03,210 --> 00:08:06,680

-other users to get your changes, do further changes push

-

-155

-00:08:06,680 --> 00:08:08,860

-them as well and then, you know, they will allow you

-

-156

-00:08:08,860 --> 00:08:10,890

-to get their changes, and so on and so forth. So

-

-157

-00:08:10,890 --> 00:08:15,540

-really allows this collaboration between different users and keeping track

-

-158

-00:08:15,540 --> 00:08:18,730

-of all the changes made by the different users. So now

-

-159

-00:08:18,730 --> 00:08:21,860

-let's look at some more advanced concept, which are the concept

-

-160

-00:08:21,860 --> 00:08:25,600

-of branching, and merging. So what branching means is basically is

-

-161

-00:08:25,600 --> 00:08:28,540

-to make a copy, to create a branch of the current

-

-162

-00:08:28,540 --> 00:08:32,070

-project so that we can work on that copy indpendently from the

-

-163

-00:08:32,070 --> 00:08:34,740

-other copy, from the other branch. And then we can decide whether

-

-164

-00:08:34,740 --> 00:08:37,190

-we want to keep, both branches, or we want to merge them at

-

-165

-00:08:37,190 --> 00:08:40,510

-some point. And you can of course have multiple branches, not just two.

-

-166

-00:08:40,510 --> 00:08:43,558

-And the reason why this is particularly useful is because in many

-

-167

-00:08:43,558 --> 00:08:46,790

-cases if you think, about the way we develop software in general,

-

-168

-00:08:46,790 --> 00:08:50,030

-we work with artifacts. We might have the need to create kind

-

-169

-00:08:50,030 --> 00:08:53,910

-of a separate copy of your work space. To do some experiments for example.

-

-170

-00:08:53,910 --> 00:08:54,940

-So you want to change something in

-

-171

-00:08:54,940 --> 00:08:56,250

-the code, you're not really sure it's going to

-

-172

-00:08:56,250 --> 00:08:57,650

-work and you don't want to touch

-

-173

-00:08:57,650 --> 00:08:59,500

-your main copy. So that's the perfect application

-

-174

-00:08:59,500 --> 00:09:00,830

-for branching. If you want to do

-

-175

-00:09:00,830 --> 00:09:02,710

-something like that...you want to experiment or do

-

-176

-00:09:02,710 --> 00:09:04,800

-some modifications that you're not sure about,

-

-177

-00:09:04,800 --> 00:09:06,820

-you will branch your code, you will do

-

-178

-00:09:06,820 --> 00:09:08,230

-the changes...and then if you're happy with

-

-179

-00:09:08,230 --> 00:09:09,890

-the changes, you will merge that branch

-

-180

-00:09:09,890 --> 00:09:13,250

-with the original one, or worse if you're not happy with the changes you will

-

-181

-00:09:13,250 --> 00:09:16,680

-just throw away that branch. So this is just one possible use of branch but

-

-182

-00:09:16,680 --> 00:09:18,950

-it's one of the main uses of that. So in all let's see how that

-

-183

-00:09:18,950 --> 00:09:21,070

-can be done with git. So first of all if you

-

-184

-00:09:21,070 --> 00:09:24,740

-want to see which branches are currently present in your project, you can

-

-185

-00:09:24,740 --> 00:09:28,260

-simply execute git branch, and in this case, you can see

-

-186

-00:09:28,260 --> 00:09:31,090

-that there's only one branch, which is called master, and the star

-

-187

-00:09:31,090 --> 00:09:33,940

-there indicates that this is our current branch. So how do

-

-188

-00:09:33,940 --> 00:09:37,210

-we create a new branch? So we simply run the command

-

-189

-00:09:37,210 --> 00:09:41,010

-git branch and specify a name for the new branch, for example we'll

-

-190

-00:09:41,010 --> 00:09:44,110

-call it newBranch, to make it very explicit. At this point,

-

-191

-00:09:44,110 --> 00:09:46,940

-if we run git branch of course, we will have

-

-192

-00:09:46,940 --> 00:09:50,410

-a new branch plus master will still be our current branch. So

-

-193

-00:09:50,410 --> 00:09:52,780

-if you want to switch to the new branch, we will use

-

-194

-00:09:52,780 --> 00:09:56,510

-the git checkout command and specify the name of the branch that

-

-195

-00:09:56,510 --> 00:10:00,220

-we want to become our current branch. So when we run that,

-

-196

-00:10:00,220 --> 00:10:02,780

-git will tell us that we switched to the new branch. And

-

-197

-00:10:02,780 --> 00:10:05,920

-if we run git branch you will see that now the star

-

-198

-00:10:05,920 --> 00:10:09,130

-is next to newBranch because that's our current branch. There is a

-

-199

-00:10:09,130 --> 00:10:12,834

-shortcut for these two commands. If you run the command git

-

-200

-00:10:12,834 --> 00:10:17,240

-checkout specify the -b flag and then the name of

-

-201

-00:10:17,240 --> 00:10:19,790

-the new branch it will do both things at the same

-

-202

-00:10:19,790 --> 00:10:22,910

-time. It will create the new branch called testing in this

-

-203

-00:10:22,910 --> 00:10:25,760

-case, and then it will switch to new branch and then

-

-204

-00:10:25,760 --> 00:10:28,860

-it will tell you after executing the command. So now if

-

-205

-00:10:28,860 --> 00:10:31,290

-we look at the git branch output, you can see that

-

-206

-00:10:31,290 --> 00:10:35,090

-there is three branches and we are currently on the testing branch.

-

-207

-00:10:35,090 --> 00:10:37,300

-So now let's create a new file and just call it test

-

-208

-00:10:37,300 --> 00:10:41,180

-file, put some content in there, save it, we edit and commit it.

-

-209

-00:10:47,380 --> 00:10:50,280

-And as you can see, now in this current branch, we have our

-

-210

-00:10:50,280 --> 00:10:53,430

-testFile. So now let's switch to a different branch. So let's go back

-

-211

-00:10:53,430 --> 00:10:57,550

-to the master branch using the usual git checkout command. So now if

-

-212

-00:10:57,550 --> 00:11:00,310

-we do an ls, if we check the content of the current directory,

-

-213

-00:11:00,310 --> 00:11:03,140

-we can see that the testFile is not there, because of course, it's

-

-214

-00:11:03,140 --> 00:11:06,070

-not in this branch. so now let's assume that we are happy with

-

-215

-00:11:06,070 --> 00:11:09,260

-the testFile that we created, with the modification that we made on the

-

-216

-00:11:09,260 --> 00:11:13,080

-branch. And so we want to merge that branch with our master branch.

-

-217

-00:11:13,080 --> 00:11:16,180

-To do that we can call the git merge command and

-

-218

-00:11:16,180 --> 00:11:19,260

-we'll specify the branch that we want to merge with the current

-

-219

-00:11:19,260 --> 00:11:23,030

-one. So we will specify testing in this case. That will merge

-

-220

-00:11:23,030 --> 00:11:26,260

-the testing branch with the current branch, which is the master. Which

-

-221

-00:11:26,260 --> 00:11:29,200

-means that now the testfile is in my current working directory,

-

-222

-00:11:29,200 --> 00:11:32,180

-is in my current, Current branch. And if I run the branch,

-

-223

-00:11:32,180 --> 00:11:35,590

-you'll see that the testing branch is obviously still there, so let's

-

-224

-00:11:35,590 --> 00:11:38,370

-assume that we want to delete the testing branch at this point

-

-225

-00:11:38,370 --> 00:11:41,220

-because we don't need it anymore. We could simply execute

-

-226

-00:11:41,220 --> 00:11:44,940

-the branch -d which stands for -delete, specify

-

-227

-00:11:44,940 --> 00:11:47,670

-the name of the branch and this will eliminate that

-

-228

-00:11:47,670 --> 00:11:51,670

-branch as confirmed by running the command git branch or the

-

-229

-00:11:51,670 --> 00:11:55,030

-testing branch no longer shows up. So, something that might

-

-230

-00:11:55,030 --> 00:11:57,200

-happen when you merge a branch is, is that you

-

-231

-00:11:57,200 --> 00:12:00,000

-might have conflicts For example, in case you change the,

-

-232

-00:12:00,000 --> 00:12:03,600

-the same file into different branches. So, let's see an example

-

-233

-00:12:03,600 --> 00:12:06,730

-of that. So, we're going to check which branches we have,

-

-234

-00:12:06,730 --> 00:12:09,260

-so we have two branches, in this case, master and newBranch

-

-235

-00:12:09,260 --> 00:12:14,040

-Our current branch is master. Let's open this file called new

-

-236

-00:12:14,040 --> 00:12:19,310

-file and, add some content there. So now let's commit

-

-237

-00:12:19,310 --> 00:12:21,890

-this changes to the get to the local repository. Now

-

-238

-00:12:21,890 --> 00:12:24,600

-let's switch to the other branch and if you remember we

-

-239

-00:12:24,600 --> 00:12:26,900

-do this by running git checkout and the name of the

-

-240

-00:12:26,900 --> 00:12:29,150

-branch. And at this point we do the same operation here.

-

-241

-00:12:29,150 --> 00:12:32,090

-So we take this file and we change it here to. In this

-

-242

-00:12:32,090 --> 00:12:34,740

-case we have content that reflects the fact that we are. In the

-

-243

-00:12:34,740 --> 00:12:38,790

-new branch just for convenience. At this point, we also can move the

-

-244

-00:12:38,790 --> 00:12:41,870

-file here. The comment here is, of course, that this is the new

-

-245

-00:12:41,870 --> 00:12:44,800

-file in the new branch. So, at this point, what we have here

-

-246

-00:12:44,800 --> 00:12:47,980

-is that we have this file called newfile that has been modified

-

-247

-00:12:47,980 --> 00:12:51,320

-independently both in the master branch and in the new branch. So we

-

-248

-00:12:51,320 --> 00:12:55,090

-have a conflict. Right? So, now, let's switch back to the master branch.

-

-249

-00:12:55,090 --> 00:12:57,720

-So now, let's say we want to merge the two branches. So

-

-250

-00:12:57,720 --> 00:13:00,490

-since we are in master, we want to say that when I

-

-251

-00:13:00,490 --> 00:13:03,970

-merge the new branch into the current one. And when we run

-

-252

-00:13:03,970 --> 00:13:07,540

-that, we get an auto merging conflict. So at this point what

-

-253

-00:13:07,540 --> 00:13:10,390

-we can do, is that we can manually fix the conflict by

-

-254

-00:13:10,390 --> 00:13:13,910

-opening the new file. So the file that was showing the conflict.

-

-255

-00:13:13,910 --> 00:13:16,860

-So here you can see the kind of of information that you get

-

-256

-00:13:16,860 --> 00:13:20,340

-in the conflicted file. So it's telling you basically that there is

-

-257

-00:13:20,340 --> 00:13:23,760

-in the head which is the, the master this conflict. Which is new

-

-258

-00:13:23,760 --> 00:13:26,830

-file in master. Which is the content that we added of course. And

-

-259

-00:13:26,830 --> 00:13:30,190

-then you know, under, you know, the separator you can see the content

-

-260

-00:13:30,190 --> 00:13:32,650

-that was added in the new branch. Which is the contents in new

-

-261

-00:13:32,650 --> 00:13:35,990

-file, in new branch. So basically, what this is showing you is the

-

-262

-00:13:35,990 --> 00:13:39,150

-parts of the file that are conflicting. In this case, we only have

-

-263

-00:13:39,150 --> 00:13:41,990

-one line, is basically the whole file into two versions and you can

-

-264

-00:13:41,990 --> 00:13:45,460

-decide which version you want to keep or how you want to merge in

-

-265

-00:13:45,460 --> 00:13:48,260

-general, the two pieces. So here, let's assume that we

-

-266

-00:13:48,260 --> 00:13:52,140

-want to keep the content from the master. So what we're

-

-267

-00:13:52,140 --> 00:13:54,510

-going to do is we're going to elimate the annotations

-

-268

-00:13:54,510 --> 00:13:57,500

-and we're going to eliminate the additional content. We save this

-

-269

-00:13:57,500 --> 00:13:59,680

-file. So at this point what we need to do

-

-270

-00:13:59,680 --> 00:14:04,040

-is simply to commit the modified file (the merge file) and we

-

-271

-00:14:04,040 --> 00:14:07,440

-do that in the normal way. We call git add, specifying

-

-272

-00:14:07,440 --> 00:14:11,180

-the file, so git add newfile. Then we run git commit

-

-273

-00:14:11,180 --> 00:14:15,630

-newfile, and we specify in the comment for clarity that this is the merged file,

-

-274

-00:14:15,630 --> 00:14:19,530

-so that we performed a merge. And at this point we are done with our merge.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/14 - GIT Demo: Git + Eclipse - lang_en_vs5.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/14 - GIT Demo: Git + Eclipse - lang_en_vs5.srt
deleted file mode 100644
index b95877b..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/14 - GIT Demo: Git + Eclipse - lang_en_vs5.srt
+++ /dev/null
@@ -1,307 +0,0 @@
-1

-00:00:00,140 --> 00:00:02,580

-Now that we saw some of the git basic

-

-2

-00:00:02,580 --> 00:00:05,689

-functionalities in practice, let's go a step further. If

-

-3

-00:00:05,689 --> 00:00:08,420

-you remember I mentioned before that many of these

-

-4

-00:00:08,420 --> 00:00:12,250

-version control systems are actually integrated into IDE's. So

-

-5

-00:00:12,250 --> 00:00:14,540

-what were going to look at next is what happens

-

-6

-00:00:14,540 --> 00:00:17,500

-if we put together git and eclipse. And the

-

-7

-00:00:17,500 --> 00:00:20,960

-result is egit, or EGit is a plug in

-

-8

-00:00:20,960 --> 00:00:25,520

-for the eclipse IDE that adds git functionality to eclipse.

-

-9

-00:00:25,520 --> 00:00:27,880

-So let's see how that works in practice. So

-

-10

-00:00:27,880 --> 00:00:31,400

-support for git is available in many IDE's including

-

-11

-00:00:31,400 --> 00:00:33,920

-Eclipse. And if you want to get github

-

-12

-00:00:33,920 --> 00:00:38,620

-for Eclipse, you should go to eclipse.github.com and you can

-

-13

-00:00:38,620 --> 00:00:41,445

-download the plugin. So this bring us to the

-

-14

-00:00:41,445 --> 00:00:44,530

-plugin page and you can use the provided URL

-

-15

-00:00:44,530 --> 00:00:47,060

-and directions to install the plugin. In this case

-

-16

-00:00:47,060 --> 00:00:49,945

-we're going to copy this address. So we're going to

-

-17

-00:00:49,945 --> 00:00:54,110

-Eclipse, Help, Install new software. We can click on Add

-

-18

-00:00:54,110 --> 00:00:56,810

-to add a new site from which to get software. We

-

-19

-00:00:56,810 --> 00:00:59,110

-paste the location that we just copied here. And we

-

-20

-00:00:59,110 --> 00:01:02,842

-can give it a descriptive name. In this case I'll just

-

-21

-00:01:02,842 --> 00:01:06,645

-call it Eclipse Git plugin. Then when I click okay,

-

-22

-00:01:06,645 --> 00:01:09,720

-Eclipse will go, and look for plugins. And as you can

-

-23

-00:01:09,720 --> 00:01:12,510

-see, there are two options. We can select both of them,

-

-24

-00:01:12,510 --> 00:01:15,180

-and click on next. You can see that the Eclipse identified

-

-25

-00:01:15,180 --> 00:01:18,330

-a few dependencies. You can click next and accept them. You can

-

-26

-00:01:18,330 --> 00:01:21,540

-accept the terms and conditions for the plug in, and then just

-

-27

-00:01:21,540 --> 00:01:25,730

-finish. And at this point, Eclipse will install the plugin, which might

-

-28

-00:01:25,730 --> 00:01:28,610

-take a little bit of time. So we're just going to speed it up.

-

-29

-00:01:28,610 --> 00:01:31,110

-And when Eclipse is done, you will get this prompt that will

-

-30

-00:01:31,110 --> 00:01:33,670

-tell you that you need to restart Eclipse for the plugin to

-

-31

-00:01:33,670 --> 00:01:36,990

-be actually installed. And at this point, you want to click yes. And

-

-32

-00:01:36,990 --> 00:01:40,550

-when Eclipse restarts. You'll have your plugin. We're going to go to the git

-

-33

-00:01:40,550 --> 00:01:44,030

-repository perspective that we can select here. And when we click

-

-34

-00:01:44,030 --> 00:01:47,160

-OK, you can see that our display will change. And since

-

-35

-00:01:47,160 --> 00:01:49,360

-we don't have any repository yet, we are provided with the

-

-36

-00:01:49,360 --> 00:01:53,620

-possibility of adding an existing local git repository, cloning a git repository

-

-37

-00:01:53,620 --> 00:01:56,330

-or creating a new local git repository. We're going to add an

-

-38

-00:01:56,330 --> 00:01:59,800

-existing local repository. This is the one that we created earlier,

-

-39

-00:01:59,800 --> 00:02:02,170

-so we'll select it and click finish, and you can see

-

-40

-00:02:02,170 --> 00:02:05,660

-that my project is now added to this set of git repositories.

-

-41

-00:02:05,660 --> 00:02:09,240

-Now let's check out the project from the repository by selecting import

-

-42

-00:02:09,240 --> 00:02:12,530

-project. And here you can import something as an existing project, you

-

-43

-00:02:12,530 --> 00:02:15,300

-can use a new project wizard, and in this case I chose

-

-44

-00:02:15,300 --> 00:02:18,680

-the option of importing as a general project. Then I click Next and

-

-45

-00:02:18,680 --> 00:02:20,870

-as you can see, I have the project name up there and

-

-46

-00:02:20,870 --> 00:02:24,630

-I can click Finish. So now, if I go to the resource perspective

-

-47

-00:02:24,630 --> 00:02:27,740

-by clicking here, I can see that the project has been added

-

-48

-00:02:27,740 --> 00:02:30,760

-to my set of projects. And I can see all the files within

-

-49

-00:02:30,760 --> 00:02:33,440

-the project, particularly, if I click on the README, you can see

-

-50

-00:02:33,440 --> 00:02:36,190

-that we have the Readme file that we created before. Same thing for

-

-51

-00:02:36,190 --> 00:02:38,930

-the test file. One thing I can do at this point, it

-

-52

-00:02:38,930 --> 00:02:41,070

-to execute different git commands, perform

-

-53

-00:02:41,070 --> 00:02:43,430

-different git operations by using the team

-

-54

-00:02:43,430 --> 00:02:47,010

-submenu in the contactual menu. And here there are several things

-

-55

-00:02:47,010 --> 00:02:50,650

-I can do including some advanced commands. And just to give it a

-

-56

-00:02:50,650 --> 00:02:53,200

-shot, I am going to try to click show local history, and this

-

-57

-00:02:53,200 --> 00:02:56,180

-shows the history of the file. For example it shows the author and

-

-58

-00:02:56,180 --> 00:02:59,200

-it shows when he was created, when he was authored. Lets make

-

-59

-00:02:59,200 --> 00:03:02,810

-some changes to this file by adding some new content. Okay. I saved

-

-60

-00:03:02,810 --> 00:03:05,160

-the file and now I can see that error that indicates that my

-

-61

-00:03:05,160 --> 00:03:08,620

-file was locally changed. So now if I go to the team menu,

-

-62

-00:03:08,620 --> 00:03:11,380

-you can see that I have the option to add to the index,

-

-63

-00:03:11,380 --> 00:03:14,686

-to stage the file. And now I got this new label that star

-

-64

-00:03:14,686 --> 00:03:17,980

-that shows the files added to the index. And now at this point,

-

-65

-00:03:17,980 --> 00:03:21,270

-I can go to the team menu again and I can actually commit

-

-66

-00:03:21,270 --> 00:03:25,480

-the file by selecting the corresponding entry. This allows me to enter

-

-67

-00:03:25,480 --> 00:03:28,390

-the commit message, exactly in the same way which I could do

-

-68

-00:03:28,390 --> 00:03:31,250

-that from the command line with the textual editor. And after I

-

-69

-00:03:31,250 --> 00:03:34,050

-put the comment there, I can actually commit. And now if we

-

-70

-00:03:34,050 --> 00:03:36,320

-look at the history view, we can see here that we have

-

-71

-00:03:36,320 --> 00:03:38,960

-a new version for the file that we just modified. And we

-

-72

-00:03:38,960 --> 00:03:42,250

-can also see the commit comment. And, at this point, if we

-

-73

-00:03:42,250 --> 00:03:46,450

-had remote repository we could push our changes to that remote repository

-

-74

-00:03:46,450 --> 00:03:49,330

-as well. Again, using the team submenu and

-

-75

-00:03:49,330 --> 00:03:52,170

-the contextual menu. And, speaking of remote repositories, what we

-

-76

-00:03:52,170 --> 00:03:55,230

-are going to see next is how to use GitHub

-

-77

-00:03:55,230 --> 00:03:58,640

-repositories which are remote repositories that are hosted on GitHub.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/15 - GIT Demo: Github - lang_en_vs3.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/15 - GIT Demo: Github - lang_en_vs3.srt
deleted file mode 100644
index 5e842d7..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/15 - GIT Demo: Github - lang_en_vs3.srt
+++ /dev/null
@@ -1,239 +0,0 @@
-1

-00:00:00,120 --> 00:00:02,820

-In the interview that we did at the beginning of the class,

-

-2

-00:00:02,820 --> 00:00:08,430

-we talked with John about GitHub, where GitHub is a Git hosting website, and

-

-3

-00:00:08,430 --> 00:00:11,390

-John told you all about it. For this class, we will be

-

-4

-00:00:11,390 --> 00:00:16,350

-using GitHub as our Git hosting. Let's see how GitHub works in practice and

-

-5

-00:00:16,350 --> 00:00:19,450

-let's see some of the common features offered by GitHub.

-

-6

-00:00:19,450 --> 00:00:24,010

-This is what we'll do in the third part of this Git demo. What I'm showing here

-

-7

-00:00:24,010 --> 00:00:28,550

-is the GitHub website and as I said, GitHub is a Git hosting website and

-

-8

-00:00:28,550 --> 00:00:32,950

-you can create an account on GitHub by simply signing up on the website. And

-

-9

-00:00:32,950 --> 00:00:36,100

-because we already have an account that we're simply going to sign in

-

-10

-00:00:36,100 --> 00:00:40,570

-to see what kind of functionality GitHub offers. And we're going to specify our

-

-11

-00:00:40,570 --> 00:00:44,190

-username and password. And as you can see on the GitHub website,

-

-12

-00:00:44,190 --> 00:00:47,695

-you can use this menu up on the right to create a new repository or

-

-13

-00:00:47,695 --> 00:00:51,500

-change the account settings. Let's click on our user profile. And

-

-14

-00:00:51,500 --> 00:00:54,270

-here we can see some statistics for our user. For

-

-15

-00:00:54,270 --> 00:00:59,190

-example, we can see statistic about our contributions and our repositories. So

-

-16

-00:00:59,190 --> 00:01:02,560

-now if we go to the Repositories view, we can create a new repository.

-

-17

-00:01:02,560 --> 00:01:07,117

-We give it a name. Let's call it myrepo. We can provide the description for

-

-18

-00:01:07,117 --> 00:01:11,680

-the repository. If we want, we can initialize the repository by adding a README

-

-19

-00:01:11,680 --> 00:01:15,860

-file. And even though we are not doing it right now, if you can see up here,

-

-20

-00:01:15,860 --> 00:01:19,820

-you can also add a license here on the right and it allows you

-

-21

-00:01:19,820 --> 00:01:24,831

-to choose from a set of predefined licenses. And you can also a .gitignore file,

-

-22

-00:01:24,831 --> 00:01:28,410

-which, in case you don't know what that is, it's a very convenient file that

-

-23

-00:01:28,410 --> 00:01:32,740

-will automatically exclude from the repositories file that should not be added.

-

-24

-00:01:32,740 --> 00:01:35,690

-So if you remember in the lesson we said there are things that you should not

-

-25

-00:01:35,690 --> 00:01:39,263

-add to the repositories. For example, derived files. So

-

-26

-00:01:39,263 --> 00:01:42,360

-here, using this menu, you can pick the type of project that you have.

-

-27

-00:01:42,360 --> 00:01:47,740

-For example, Java project or PHP project or many other kinds of projects. And

-

-28

-00:01:47,740 --> 00:01:50,510

-the GitHub will automatically add that file for you.

-

-29

-00:01:50,510 --> 00:01:53,680

-But let's skip that for now and simply create our repository. And

-

-30

-00:01:53,680 --> 00:01:58,000

-that creates a repository that contains the README file because that's what we

-

-31

-00:01:58,000 --> 00:02:02,580

-decided to do. And it also allows you to edit the README file by clicking on it.

-

-32

-00:02:02,580 --> 00:02:05,560

-It will bring up an editor and here you can write, you know,

-

-33

-00:02:05,560 --> 00:02:08,949

-for example, initial readme for your project. Then you can add your

-

-34

-00:02:08,949 --> 00:02:13,070

-commit message up there and then you can commit the changes to your README file.

-

-35

-00:02:13,070 --> 00:02:18,212

-The site also provides many other features, like, for example, creating issues,

-

-36

-00:02:18,212 --> 00:02:22,030

-pull requests, adding and editing a wiki, and also, you know,

-

-37

-00:02:22,030 --> 00:02:25,740

-defining other characteristics and settings for the repository. Now, if we go to

-

-38

-00:02:25,740 --> 00:02:30,500

-the repository, you can see that we also get the HTTPS link for the repository.

-

-39

-00:02:30,500 --> 00:02:35,870

-So this is the URL that you can use to clone your repository. If you remember,

-

-40

-00:02:35,870 --> 00:02:39,250

-with a git clone command, that's the URL that you can specify. So

-

-41

-00:02:39,250 --> 00:02:43,480

-let's try to do that and clone that repository. So we're going to copy this URL.

-

-42

-00:02:43,480 --> 00:02:48,300

-To do that, we're going to execute git clone and specify the URL that we

-

-43

-00:02:48,300 --> 00:02:52,310

-just copied. And you can see that the project was created, was cloned locally.

-

-44

-00:02:52,310 --> 00:02:55,760

-And if we go under myrepo, which is the name of the repository, you can see that

-

-45

-00:02:55,760 --> 00:02:59,570

-the README file that we created on GitHub is here. So if we create a new file,

-

-46

-00:02:59,570 --> 00:03:03,340

-which we're going to call again, newFile just to be clear. And then we

-

-47

-00:03:03,340 --> 00:03:07,920

-can add it, commit it, specifying as usual a commit message. So at this point,

-

-48

-00:03:07,920 --> 00:03:11,940

-we can push our locked out changes to the remote GitHub repository. And

-

-49

-00:03:11,940 --> 00:03:14,340

-because the GitHub repository is password protected,

-

-50

-00:03:14,340 --> 00:03:17,660

-we have to specify our login and password. And of course, if you

-

-51

-00:03:17,660 --> 00:03:21,770

-pass the wrong password, GitHub is not going to let you in. So let's try again.

-

-52

-00:03:21,770 --> 00:03:25,110

-Let's try to get the password right this time. I'm going to specify again,

-

-53

-00:03:25,110 --> 00:03:31,130

-my login and my password. At this point, the push is successful and

-

-54

-00:03:31,130 --> 00:03:35,220

-my changes are actually pushed to the master, which is the GitHub repository.

-

-55

-00:03:35,220 --> 00:03:39,020

-To double check that, let's go back to the GitHub repository and as you can see,

-

-56

-00:03:39,020 --> 00:03:42,470

-that the file that we added, newFile, is there as expected. And of course,

-

-57

-00:03:42,470 --> 00:03:45,880

-there's many more things that you can do on the GitHub website, so

-

-58

-00:03:45,880 --> 00:03:48,410

-I strongly encourage you to go and try out things. But

-

-59

-00:03:48,410 --> 00:03:51,980

-the key message here is that the GitHub is a Git hosting website where you

-

-60

-00:03:51,980 --> 00:03:54,990

-can get an account and create your remote repositories.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/16 - GIT Recap - lang_en_vs5.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/16 - GIT Recap - lang_en_vs5.srt
deleted file mode 100644
index b35fc59..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/16 - GIT Recap - lang_en_vs5.srt
+++ /dev/null
@@ -1,35 +0,0 @@
-1

-00:00:00,110 --> 00:00:02,212

-Now that we are done with our demo, I just want

-

-2

-00:00:02,212 --> 00:00:05,910

-to go through a quick GIT recap to remind you of the

-

-3

-00:00:05,910 --> 00:00:08,720

-main commands that we saw, and what they do. And you can

-

-4

-00:00:08,720 --> 00:00:11,290

-also use these as sort of a reference when you work with

-

-5

-00:00:11,290 --> 00:00:13,940

-GIT. And by the way, if you look around and you do

-

-6

-00:00:13,940 --> 00:00:16,960

-a search, you can see that there's tons of examples on the

-

-7

-00:00:16,960 --> 00:00:22,170

-web of GitHub tutorials, videos, examples, manuals. So feel free to

-

-8

-00:00:22,170 --> 00:00:25,910

-explore. And I'm actually going to put some references to tutorials and

-

-9

-00:00:25,910 --> 00:00:29,100

-videos that I found particularly useful in the notes for the class.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/17 - GIT Recap: Local Repositories - lang_en_vs5.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/17 - GIT Recap: Local Repositories - lang_en_vs5.srt
deleted file mode 100644
index c29fae8..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/17 - GIT Recap: Local Repositories - lang_en_vs5.srt
+++ /dev/null
@@ -1,163 +0,0 @@
-1

-00:00:00,100 --> 00:00:02,460

-So, let me start by recapping some of the operations that

-

-2

-00:00:02,460 --> 00:00:06,000

-we can perform on local repositories. I'm just going to list them

-

-3

-00:00:06,000 --> 00:00:09,240

-here and go through them by separating them into three main

-

-4

-00:00:09,240 --> 00:00:12,930

-categories. The first one is commands that, to create a repository and

-

-5

-00:00:12,930 --> 00:00:15,470

-notice that not all of these are git commands, that for

-

-6

-00:00:15,470 --> 00:00:18,710

-example, to create the repository, we would normally want to. Create a

-

-7

-00:00:18,710 --> 00:00:21,560

-directory, which is exactly what we did in our demo. We want

-

-8

-00:00:21,560 --> 00:00:25,310

-to go to that directory and then execute the git init statement,

-

-9

-00:00:25,310 --> 00:00:29,110

-which initializes that directory as a git repository. The second

-

-10

-00:00:29,110 --> 00:00:32,530

-category includes commands that we'll use to modify the content of

-

-11

-00:00:32,530 --> 00:00:35,280

-the repository. We saw that we can use git add

-

-12

-00:00:35,280 --> 00:00:39,190

-to add a specific file or a complete directory to our

-

-13

-00:00:39,190 --> 00:00:41,650

-index. So to the list of files that will be

-

-14

-00:00:41,650 --> 00:00:44,510

-committed, that will be considered in the next commit. Then we

-

-15

-00:00:44,510 --> 00:00:47,620

-can use commit to actually commit the changes that we

-

-16

-00:00:47,620 --> 00:00:50,374

-made to those files to our local repository, and we can

-

-17

-00:00:50,374 --> 00:00:54,030

-also use git move and git rm or git remove

-

-18

-00:00:54,030 --> 00:00:57,420

-to move files around and to remove files. Finally, the

-

-19

-00:00:57,420 --> 00:01:00,270

-third category is the category of commands that we can

-

-20

-00:01:00,270 --> 00:01:04,950

-use to inspect the concrete repository. And this set includes git

-

-21

-00:01:04,950 --> 00:01:06,960

-log, that we can use to see the log of

-

-22

-00:01:06,960 --> 00:01:09,970

-the repository, git status, that can give us important information

-

-23

-00:01:09,970 --> 00:01:12,810

-about the status of the file center repository. Git diff,

-

-24

-00:01:12,810 --> 00:01:15,500

-that we can use to see the differences between for example,

-

-25

-00:01:15,500 --> 00:01:19,160

-our local files. And the remote files. And finally git

-

-26

-00:01:19,160 --> 00:01:23,270

-show, that will show us information about our last commit. What

-

-27

-00:01:23,270 --> 00:01:25,940

-we committed, what were the changes and so on. And again,

-

-28

-00:01:25,940 --> 00:01:29,290

-we saw most or all of these commands in our demo.

-

-29

-00:01:29,290 --> 00:01:31,920

-So let me also remind you of a possible workflow. Which

-

-30

-00:01:31,920 --> 00:01:34,350

-again, we already saw but it's always good to go through

-

-31

-00:01:34,350 --> 00:01:37,670

-it once more. And remember that this is just an example.

-

-32

-00:01:37,670 --> 00:01:40,520

-It's just a possible workflow. You can do many different things,

-

-33

-00:01:40,520 --> 00:01:43,210

-you can have many different workflows with git. This is just

-

-34

-00:01:43,210 --> 00:01:45,980

-up to illustrate some of the things that you can do. So,

-

-35

-00:01:45,980 --> 00:01:49,430

-you might do some local editing. Execute git status to see what

-

-36

-00:01:49,430 --> 00:01:53,020

-files you changed. Then you might run a git diff on the

-

-37

-00:01:53,020 --> 00:01:56,230

-files to see what are these changes. And then you can run

-

-38

-00:01:56,230 --> 00:01:59,460

-git commit -a to commit your changes. And in case you

-

-39

-00:01:59,460 --> 00:02:02,520

-want to specify the commit message right away without having to go

-

-40

-00:02:02,520 --> 00:02:06,040

-through an editor, you can also add the -m parameter and

-

-41

-00:02:06,040 --> 00:02:08,110

-specify the message here on the same line.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/18 - GIT Recap: Remote Repositories - lang_en_vs3.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/18 - GIT Recap: Remote Repositories - lang_en_vs3.srt
deleted file mode 100644
index 9afccc9..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/18 - GIT Recap: Remote Repositories - lang_en_vs3.srt
+++ /dev/null
@@ -1,59 +0,0 @@
-1

-00:00:00,110 --> 00:00:02,960

-SImilarly, let's go through some commands that you can run on

-

-2

-00:00:02,960 --> 00:00:07,150

-remote repositories. First command is the command to copy a repository,

-

-3

-00:00:07,150 --> 00:00:10,840

-which is git clone in which you get a remote repository and you make a lot of

-

-4

-00:00:10,840 --> 00:00:14,850

-copy in your working directory. The repository can be specified as a URL.

-

-5

-00:00:14,850 --> 00:00:18,230

-It can be a local file, it can be specified using the HTTP or

-

-6

-00:00:18,230 --> 00:00:21,070

-the SSH protocol, and there's also other ways to do it.

-

-7

-00:00:21,070 --> 00:00:25,300

-This creates a complete local copy of the repository, as it says, and links it

-

-8

-00:00:25,300 --> 00:00:29,030

-to the remote repository, which is what is called the origin. And if you want,

-

-9

-00:00:29,030 --> 00:00:33,400

-you could also actually link to the repository, later. Then the normal way of

-

-10

-00:00:33,400 --> 00:00:37,800

-receiving changes from a repository is to perform a git pull command. And we saw

-

-11

-00:00:37,800 --> 00:00:42,345

-that you can also perform the same operation through two commands, get fetch and

-

-12

-00:00:42,345 --> 00:00:47,210

-git merge. In case you want to inspect the changes before actually merging them,

-

-13

-00:00:47,210 --> 00:00:49,550

-before actually getting them in your local copy. And

-

-14

-00:00:49,550 --> 00:00:52,940

-if you want to send changes that you have in your local repository to

-

-15

-00:00:52,940 --> 00:00:55,680

-a remote repository, you will use the git push command.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/19 - GitHub Setup Assignment - lang_en_vs2.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/19 - GitHub Setup Assignment - lang_en_vs2.srt
deleted file mode 100644
index 9dec29b..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/19 - GitHub Setup Assignment - lang_en_vs2.srt
+++ /dev/null
@@ -1,15 +0,0 @@
-1

-00:00:00,160 --> 00:00:03,095

-This is ultimately pretty simple. All you need to do is visit

-

-2

-00:00:03,095 --> 00:00:08,720

-github.com/join and set up a free GitHub account. If you already have a GitHub,

-

-3

-00:00:08,720 --> 00:00:11,870

-account you can sign in using your existing account. If you want to

-

-4

-00:00:11,870 --> 00:00:14,550

-use a separate identity for the class, feel free to set up a second one.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/19 - GitHub Setup Assignment - lang_pt_vs1.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/19 - GitHub Setup Assignment - lang_pt_vs1.srt
deleted file mode 100644
index 6dc6f48..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/19 - GitHub Setup Assignment - lang_pt_vs1.srt
+++ /dev/null
@@ -1,19 +0,0 @@
-1

-00:00:00,160 --> 00:00:03,095

-Na verdade é muito simples. 

-Só tens que ir a

-

-2

-00:00:03,095 --> 00:00:08,720

-github.com/join e criar uma conta grátis

-no GitHub. Se já tiveres uma conta GitHub,

-

-3

-00:00:08,720 --> 00:00:11,870

-podes entrar com a tua conta.

-Se quiseres

-

-4

-00:00:11,870 --> 00:00:14,550

-criar uma diferente para o curso,

-podes criar uma segunda sem problemas.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/2 - Interview with John Britton - lang_en_vs5.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/2 - Interview with John Britton - lang_en_vs5.srt
deleted file mode 100644
index 999833f..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/2 - Interview with John Britton - lang_en_vs5.srt
+++ /dev/null
@@ -1,435 +0,0 @@
-1

-00:00:00,170 --> 00:00:02,630

-&gt;&gt; And I thought that the best way to break the ice on version

-

-2

-00:00:02,630 --> 00:00:04,970

-control systems and Git and some other

-

-3

-00:00:04,970 --> 00:00:07,939

-related concepts was to interview John Britton who

-

-4

-00:00:07,939 --> 00:00:11,840

-works with GitHub. So let's go and see what John has to say about

-

-5

-00:00:11,840 --> 00:00:14,120

-Git, about version control systems in general,

-

-6

-00:00:14,120 --> 00:00:17,809

-and about GitHub. John is in Tapei, if I'm not wrong.

-

-7

-00:00:17,809 --> 00:00:18,610

-&gt;&gt; That's correct.

-

-8

-00:00:18,610 --> 00:00:20,320

-&gt;&gt; Okay so we're, you know we couldn't

-

-9

-00:00:20,320 --> 00:00:22,570

-go there so we're interviewing him remotely. And I

-

-10

-00:00:22,570 --> 00:00:25,490

-want, I just want to thank you so much and John for agreeing to talk to us.

-

-11

-00:00:25,490 --> 00:00:27,940

-&gt;&gt; Thank you very much for having me it was my pleasure.

-

-12

-00:00:27,940 --> 00:00:30,560

-&gt;&gt; And, I'm just going to ask, a few

-

-13

-00:00:30,560 --> 00:00:32,938

-general questions because John is an expert on,

-

-14

-00:00:32,938 --> 00:00:36,270

-Git and GitHub. John is a developer and

-

-15

-00:00:36,270 --> 00:00:38,550

-a community builder is active in both the

-

-16

-00:00:38,550 --> 00:00:42,200

-open source and the open education areas. And

-

-17

-00:00:42,200 --> 00:00:44,860

-as an educational liaison we have, is working

-

-18

-00:00:44,860 --> 00:00:47,580

-to improve Computer Science education by bringing the

-

-19

-00:00:47,580 --> 00:00:51,460

-principles of open source into the classroom. And

-

-20

-00:00:51,460 --> 00:00:53,160

-I'm going to start with an general question,

-

-21

-00:00:53,160 --> 00:00:55,320

-which is what is a version control system?

-

-22

-00:00:55,320 --> 00:00:57,960

-&gt;&gt; So, a version control system is

-

-23

-00:00:57,960 --> 00:01:00,360

-a tool that software developers use. Anybody

-

-24

-00:01:00,360 --> 00:01:02,560

-who's doing you know, working with digital

-

-25

-00:01:02,560 --> 00:01:06,540

-assets, digital projects can also use for

-

-26

-00:01:06,540 --> 00:01:11,320

-keeping track of, you know, revisions of your project, and when I say revisions, I

-

-27

-00:01:11,320 --> 00:01:16,850

-mean essentially snapshots of your project over time. So you can imagine doing

-

-28

-00:01:16,850 --> 00:01:19,720

-some work and then every so often, be it, every couple of

-

-29

-00:01:19,720 --> 00:01:23,799

-hours, every couple of days, saving a permanent snapshot of your project.

-

-30

-00:01:24,880 --> 00:01:26,650

-&gt;&gt; Why is this useful? I understand that

-

-31

-00:01:26,650 --> 00:01:28,720

-it is nice to take a snapshot of your

-

-32

-00:01:28,720 --> 00:01:30,070

-project, but what did you do with the

-

-33

-00:01:30,070 --> 00:01:33,420

-snapshot afterwards? I think the most immediately obvious benefit

-

-34

-00:01:33,420 --> 00:01:36,340

-to having snapshots of your project to keeping

-

-35

-00:01:36,340 --> 00:01:38,280

-revisions is that you can go back. If you

-

-36

-00:01:38,280 --> 00:01:40,190

-have ever worked on a project and got to

-

-37

-00:01:40,190 --> 00:01:41,940

-a point where you solved a bunch of your

-

-38

-00:01:41,940 --> 00:01:45,330

-problems, and there is just one more step to do. And

-

-39

-00:01:45,330 --> 00:01:47,640

-you start working on trying to solve that last step, and

-

-40

-00:01:47,640 --> 00:01:51,350

-you break things, you make it worse then it was an

-

-41

-00:01:51,350 --> 00:01:54,420

-hour ago. At that point its easier to just go back

-

-42

-00:01:54,420 --> 00:01:56,780

-to what you had then trying to figure out what you

-

-43

-00:01:56,780 --> 00:01:59,320

-broke. So you can always go back in time, and the

-

-44

-00:01:59,320 --> 00:02:02,660

-other big one is being able to collaborate with multiple people,

-

-45

-00:02:02,660 --> 00:02:07,450

-so its pretty seldom these days that you. Work on a production

-

-46

-00:02:07,450 --> 00:02:09,860

-totally on your own. It's most common to work in, you

-

-47

-00:02:09,860 --> 00:02:12,993

-know, in teams and small groups. And so, using a revision

-

-48

-00:02:12,993 --> 00:02:16,340

-control system allows you to collaborate with other people. And make

-

-49

-00:02:16,340 --> 00:02:19,060

-sure that you don't step on each other's toes as you're working.

-

-50

-00:02:19,060 --> 00:02:21,310

-&gt;&gt; Alright, that's great, because those are exactly some of the

-

-51

-00:02:21,310 --> 00:02:25,250

-topics that we're going to cover in the lesson. And so since we're

-

-52

-00:02:25,250 --> 00:02:28,470

-going to talk about the specifics of version control system which is

-

-53

-00:02:28,470 --> 00:02:32,660

-Git and you're definitely an expert in, in Git. So what would

-

-54

-00:02:32,660 --> 00:02:36,510

-you say is specifically special about Git? What characterizes it

-

-55

-00:02:36,510 --> 00:02:39,940

-and how does it compare to other version control systems.

-

-56

-00:02:39,940 --> 00:02:43,140

-&gt;&gt; So if any of you have used version control systems before, you

-

-57

-00:02:43,140 --> 00:02:47,850

-may have heard of something like subversion, CVS, or maybe a commercial solution

-

-58

-00:02:47,850 --> 00:02:53,550

-like ProForce. I think the main important characteristics of Git are first that

-

-59

-00:02:53,550 --> 00:02:56,050

-it's open source. And the second,

-

-60

-00:02:56,050 --> 00:02:59,030

-that it's a distributed version control system.

-

-61

-00:02:59,030 --> 00:03:00,430

-So what that means, the distributed version

-

-62

-00:03:00,430 --> 00:03:04,260

-control system is essentially a system for tracking

-

-63

-00:03:04,260 --> 00:03:07,700

-revisions of your software that doesn't have any

-

-64

-00:03:07,700 --> 00:03:11,730

-central repository. So the biggest characteristic is that

-

-65

-00:03:11,730 --> 00:03:14,520

-I can do my work and you can also work on the same project at

-

-66

-00:03:14,520 --> 00:03:16,900

-the same time without communicating with each other

-

-67

-00:03:16,900 --> 00:03:19,650

-and without communicating to a central system.

-

-68

-00:03:19,650 --> 00:03:24,190

-&gt;&gt; Okay, great. And so now that we saw what Git is, what is

-

-69

-00:03:24,190 --> 00:03:26,050

-GitHub and how does it fit into

-

-70

-00:03:26,050 --> 00:03:29,320

-this picture of the distributed, revision control system?

-

-71

-00:03:29,320 --> 00:03:34,800

-&gt;&gt; So GitHub is, the world's largest code host, and we essentially have a

-

-72

-00:03:34,800 --> 00:03:36,940

-website where you can collaborate with people

-

-73

-00:03:36,940 --> 00:03:39,950

-when you're writing code. There's two ways you

-

-74

-00:03:39,950 --> 00:03:43,650

-can use GitHub. You can use it publicly for open source and you can use

-

-75

-00:03:43,650 --> 00:03:49,660

-it in private within your team, or your company, or within your class. And, Git

-

-76

-00:03:49,660 --> 00:03:53,960

-Hub started out just as a way to host your Git repositories. But it's

-

-77

-00:03:53,960 --> 00:03:56,000

-actually grown into quite a bit more. It's

-

-78

-00:03:56,000 --> 00:03:59,820

-an entire collaboration system around your code.

-

-79

-00:03:59,820 --> 00:04:00,580

-&gt;&gt; How many users do you have?

-

-80

-00:04:00,580 --> 00:04:03,620

-&gt;&gt; I would say that we're approaching five million.

-

-81

-00:04:03,620 --> 00:04:05,570

-I don't know the exact number. We're definitely more

-

-82

-00:04:05,570 --> 00:04:08,080

-than four million right now. But yeah, I'd say

-

-83

-00:04:08,080 --> 00:04:10,330

-somewhere, somewhere close to between four and five million.

-

-84

-00:04:10,330 --> 00:04:14,750

-&gt;&gt; So that's a lot space I'd guess. Terabytes of disk

-

-85

-00:04:14,750 --> 00:04:15,840

-space, I would imagine.

-

-86

-00:04:15,840 --> 00:04:19,170

-&gt;&gt; There are a lot of GIT repositories on, on our servers.

-

-87

-00:04:19,170 --> 00:04:21,180

-&gt;&gt; Something else you want to say? I

-

-88

-00:04:21,180 --> 00:04:23,920

-guess that the when taking about GitHub there's one

-

-89

-00:04:23,920 --> 00:04:26,110

-thing that you kind of can't leave out and

-

-90

-00:04:26,110 --> 00:04:28,670

-that's that's a feature that's called a pull request.

-

-91

-00:04:28,670 --> 00:04:31,090

-So when you're using GitHub, you can share

-

-92

-00:04:31,090 --> 00:04:34,940

-your Git repository, do some work, and actually do

-

-93

-00:04:34,940 --> 00:04:37,880

-do a code review. Of proposed changes which

-

-94

-00:04:37,880 --> 00:04:39,770

-is what we call a pull request on github.com.

-

-95

-00:04:39,770 --> 00:04:42,790

-Essentially what it lets you do is have a discussion

-

-96

-00:04:42,790 --> 00:04:46,320

-about a set of proposed changes and leave feedback in

-

-97

-00:04:46,320 --> 00:04:48,870

-line with the code. You could say for example, this

-

-98

-00:04:48,870 --> 00:04:51,670

-method needs to be re-factored or I think I found if

-

-99

-00:04:51,670 --> 00:04:54,830

-off by one error here, just different kinds of feedback

-

-100

-00:04:54,830 --> 00:04:59,120

-so that before you totally integrate some proposed changes. You have,

-

-101

-00:04:59,120 --> 00:05:01,180

-kind of a conversation about what your code. And I

-

-102

-00:05:01,180 --> 00:05:03,050

-think that's really valuable when you are working in a team.

-

-103

-00:05:03,050 --> 00:05:05,510

-&gt;&gt; Thank you, John, that was very informative and

-

-104

-00:05:05,510 --> 00:05:07,440

-thanks again for taking the time to talk to us.

-

-105

-00:05:07,440 --> 00:05:10,160

-&gt;&gt; No problem, thanks for having me. I'll talk to you soon.

-

-106

-00:05:10,160 --> 00:05:13,990

-&gt;&gt; Let's thank again John for enlightening us

-

-107

-00:05:13,990 --> 00:05:17,350

-on some aspects of version control systems, Git and

-

-108

-00:05:17,350 --> 00:05:19,410

-GitHub. And now, let's go over some of the

-

-109

-00:05:19,410 --> 00:05:21,650

-topics that we discussed with John to recap them.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/3 - Version Control System Introduction - lang_en_vs5.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/3 - Version Control System Introduction - lang_en_vs5.srt
deleted file mode 100644
index be0515b..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/3 - Version Control System Introduction - lang_en_vs5.srt
+++ /dev/null
@@ -1,207 +0,0 @@
-1

-00:00:00,160 --> 00:00:02,080

-So first of all, what is a version

-

-2

-00:00:02,080 --> 00:00:05,550

-control system? A version control system or VCS,

-

-3

-00:00:05,550 --> 00:00:07,670

-is a system that allows you to manage

-

-4

-00:00:07,670 --> 00:00:11,180

-multiple revisions of the same unit of information. For

-

-5

-00:00:11,180 --> 00:00:14,330

-example of documents, of source files or any

-

-6

-00:00:14,330 --> 00:00:17,380

-other item of that sort. And as the graphical

-

-7

-00:00:17,380 --> 00:00:21,240

-depiction shows, a VCS allows a multiple actors.

-

-8

-00:00:21,240 --> 00:00:25,020

-Here we have four, to cooperate and share files.

-

-9

-00:00:25,020 --> 00:00:26,980

-Now, let's drill into this concept in a little

-

-10

-00:00:26,980 --> 00:00:29,720

-more detail. And let's do that by discussing why

-

-11

-00:00:29,720 --> 00:00:32,870

-is VCS useful, especially in the context of software

-

-12

-00:00:32,870 --> 00:00:35,790

-engineering and of software development. So first of all,

-

-13

-00:00:35,790 --> 00:00:39,570

-using a version control system enforces discipline, because it

-

-14

-00:00:39,570 --> 00:00:43,030

-manages the process by which the control of items

-

-15

-00:00:43,030 --> 00:00:46,720

-passes from one person to another. Another important aspect

-

-16

-00:00:46,720 --> 00:00:51,170

-of VCS is that it allows you for archiving versions.

-

-17

-00:00:51,170 --> 00:00:54,330

-So you can store subsequent versions of source controlled

-

-18

-00:00:54,330 --> 00:00:57,450

-items into a VCS. And not only you can

-

-19

-00:00:57,450 --> 00:01:00,450

-store versions, you can also maintain a lot of

-

-20

-00:01:00,450 --> 00:01:03,480

-interesting and important historical information

-

-21

-00:01:03,480 --> 00:01:05,810

-about these versions. For example,

-

-22

-00:01:05,810 --> 00:01:08,070

-a VCL will store information such as, who is

-

-23

-00:01:08,070 --> 00:01:11,270

-the author for this specific version stored in the system.

-

-24

-00:01:11,270 --> 00:01:13,820

-Or, for another example, on what day and what

-

-25

-00:01:13,820 --> 00:01:16,260

-time that version was stored. And a lot of other

-

-26

-00:01:16,260 --> 00:01:19,240

-interesting information about the specific version of the

-

-27

-00:01:19,240 --> 00:01:21,600

-item. Information that you can then retrieve and for

-

-28

-00:01:21,600 --> 00:01:25,040

-example, use to compare versions. Obviously, the fact of

-

-29

-00:01:25,040 --> 00:01:27,970

-having a central repository in which all these items

-

-30

-00:01:27,970 --> 00:01:31,350

-are stored enables collaboration, so people can more easily

-

-31

-00:01:31,350 --> 00:01:35,510

-share data, share files, share documents through the use

-

-32

-00:01:35,510 --> 00:01:37,950

-of VCS. And I'm sure that you all had

-

-33

-00:01:37,950 --> 00:01:41,320

-the experience of deleting a file by mistake or

-

-34

-00:01:41,320 --> 00:01:43,860

-modifying a file in the wrong way, or in the

-

-35

-00:01:43,860 --> 00:01:47,830

-most common case of changing something in your code for instance.

-

-36

-00:01:47,830 --> 00:01:50,490

-And breaking something and not being able to go back

-

-37

-00:01:50,490 --> 00:01:53,630

-to a version that was working. Not remembering, for example, what

-

-38

-00:01:53,630 --> 00:01:56,130

-is that you changed that broke the code. In all

-

-39

-00:01:56,130 --> 00:01:59,850

-these cases a version control system can be extremely useful because

-

-40

-00:01:59,850 --> 00:02:03,330

-it will allow you to recover from this accidental deletions

-

-41

-00:02:03,330 --> 00:02:06,690

-or edits. And for example, to go back of yesterdays version

-

-42

-00:02:06,690 --> 00:02:09,949

-that was working perfectly, and also to compare, for example, yesterdays

-

-43

-00:02:09,949 --> 00:02:12,920

-version with today version and see what is that you changed.

-

-44

-00:02:12,920 --> 00:02:16,000

-Finally, a version control system will normally also allow you to

-

-45

-00:02:16,000 --> 00:02:20,460

-conserve and save disk space on both the source control client

-

-46

-00:02:20,460 --> 00:02:23,880

-and on the server. Why? Well, for instance because it's centralizing

-

-47

-00:02:23,880 --> 00:02:26,570

-the management of the version. So instead of having many copies

-

-48

-00:02:26,570 --> 00:02:29,480

-spread around, you'll have only one central point where these copies

-

-49

-00:02:29,480 --> 00:02:32,240

-are stored or a few points where these copies are stored.

-

-50

-00:02:32,240 --> 00:02:34,330

-In addition, version control system often

-

-51

-00:02:34,330 --> 00:02:37,470

-uses efficient algorithms to store these changes.

-

-52

-00:02:37,470 --> 00:02:41,310

-And therefore, you can keep many versions without taking up too much space.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/4 - VCS Quiz - lang_en_vs4.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/4 - VCS Quiz - lang_en_vs4.srt
deleted file mode 100644
index 26d9c55..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/4 - VCS Quiz - lang_en_vs4.srt
+++ /dev/null
@@ -1,31 +0,0 @@
-1

-00:00:00,100 --> 00:00:02,430

-Now before we continue, and we look at more details

-

-2

-00:00:02,430 --> 00:00:04,400

-of version control systems, I want to ask you a

-

-3

-00:00:04,400 --> 00:00:07,230

-quick question about VCS. I want to know whether you

-

-4

-00:00:07,230 --> 00:00:10,190

-have used a version control system before, and if so,

-

-5

-00:00:10,190 --> 00:00:12,090

-which one or which ones. I'm going to list in

-

-6

-00:00:12,090 --> 00:00:15,260

-here some of the most commonly used version control systems,

-

-7

-00:00:15,260 --> 00:00:18,840

-like CVS, Subversion, GIT, and I'm also allowing you to

-

-8

-00:00:18,840 --> 00:00:22,640

-specify other VCS in case you have used different ones.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/5 - VCS Quiz Solution - lang_en_vs7.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/5 - VCS Quiz Solution - lang_en_vs7.srt
deleted file mode 100644
index 1a380a5..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/5 - VCS Quiz Solution - lang_en_vs7.srt
+++ /dev/null
@@ -1,11 +0,0 @@
-1

-00:00:00,130 --> 00:00:03,030

-And of course there's no right answer for this. I just wanted to collect some

-

-2

-00:00:03,030 --> 00:00:05,020

-statistics. To see what kind of previous

-

-3

-00:00:05,020 --> 00:00:07,100

-experience you have with this kind of systems.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/6 - Essential Actions - lang_en_vs5.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/6 - Essential Actions - lang_en_vs5.srt
deleted file mode 100644
index 5159d9b..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/6 - Essential Actions - lang_en_vs5.srt
+++ /dev/null
@@ -1,79 +0,0 @@
-1

-00:00:00,140 --> 00:00:02,220

-What I want to do next, is to look at how

-

-2

-00:00:02,220 --> 00:00:05,780

-version control systems actually work. We saw what they are. We

-

-3

-00:00:05,780 --> 00:00:08,130

-saw why they are useful. But how do they actually work?

-

-4

-00:00:08,130 --> 00:00:11,460

-And we're going to do that by starting from some essential

-

-5

-00:00:11,460 --> 00:00:15,400

-actions that version control systems perform. The first one is the

-

-6

-00:00:15,400 --> 00:00:18,920

-addition of files. So, when you use a version control system,

-

-7

-00:00:18,920 --> 00:00:22,280

-you can add a file to the repository. And at that

-

-8

-00:00:22,280 --> 00:00:25,400

-point the file will be accessible to other people who have access

-

-9

-00:00:25,400 --> 00:00:28,640

-to the repository. And now the fundamental action is commit.

-

-10

-00:00:28,640 --> 00:00:31,230

-When you change a file, a file that is already in

-

-11

-00:00:31,230 --> 00:00:33,610

-the repository, when you make some local changes to a

-

-12

-00:00:33,610 --> 00:00:36,430

-file that is already in the repository, you want then to

-

-13

-00:00:36,430 --> 00:00:39,460

-commit your changes to the central repository, so they can

-

-14

-00:00:39,460 --> 00:00:43,990

-become visible to all of the other users on the repository. Finally,

-

-15

-00:00:43,990 --> 00:00:47,770

-another fundamental action is the action of updating a file. If

-

-16

-00:00:47,770 --> 00:00:50,650

-we have a repository and someone else can modify the files

-

-17

-00:00:50,650 --> 00:00:52,800

-in the repository, I want to be able to get

-

-18

-00:00:52,800 --> 00:00:55,550

-the changes that other people made to the files in the

-

-19

-00:00:55,550 --> 00:00:58,980

-repository. And these are just three of the basic actions, but

-

-20

-00:00:58,980 --> 00:01:01,870

-there are many, many more. And we'll see several of those.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/7 - Example Workflow - lang_en_vs5.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/7 - Example Workflow - lang_en_vs5.srt
deleted file mode 100644
index c2f58df..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/7 - Example Workflow - lang_en_vs5.srt
+++ /dev/null
@@ -1,111 +0,0 @@
-1

-00:00:00,160 --> 00:00:02,830

-Before looking at additional actions, though, I would like to

-

-2

-00:00:02,830 --> 00:00:06,770

-see what is the basic workflow in a version control system

-

-3

-00:00:06,770 --> 00:00:09,370

-using the three actions that we just saw. And to

-

-4

-00:00:09,370 --> 00:00:11,760

-do that I'm going to use two of our friends, Brad

-

-5

-00:00:11,760 --> 00:00:14,590

-and Janet. So we have Janet here, Brad, and a

-

-6

-00:00:14,590 --> 00:00:18,440

-VCS that they are using. Now imagine that Janet creates a

-

-7

-00:00:18,440 --> 00:00:23,020

-file called foo.txt and puts some information in the file.

-

-8

-00:00:23,020 --> 00:00:25,250

-At that point she might want to add the file to

-

-9

-00:00:25,250 --> 00:00:28,340

-the repository and to commit it so that her changes

-

-10

-00:00:28,340 --> 00:00:31,210

-and the file get to the central repository. And when she

-

-11

-00:00:31,210 --> 00:00:33,900

-adds and commit, that's exactly what will happen, in foo

-

-12

-00:00:33,900 --> 00:00:36,870

-will be come available here, and will be accessible to the

-

-13

-00:00:36,870 --> 00:00:40,330

-other users. In this case it'll be accessible to Brad.

-

-14

-00:00:40,330 --> 00:00:44,190

-If Brett were to run an update command, what will happen

-

-15

-00:00:44,190 --> 00:00:47,800

-is that the file foo.txt will be copied on the local

-

-16

-00:00:47,800 --> 00:00:50,460

-work space of Brad and Brad will be able to access

-

-17

-00:00:50,460 --> 00:00:52,980

-the file. At this point Brad might want to modify

-

-18

-00:00:52,980 --> 00:00:57,110

-the file, for example add something to this existing file.

-

-19

-00:00:57,110 --> 00:00:59,410

-After doing that, he also may want to share the

-

-20

-00:00:59,410 --> 00:01:02,900

-updated file with Janet. To do that, he will commit the

-

-21

-00:01:02,900 --> 00:01:06,070

-file and the result will be exactly the same of

-

-22

-00:01:06,070 --> 00:01:09,470

-when Janet committed her file. That the updated file will

-

-23

-00:01:09,470 --> 00:01:11,890

-be sent to the repository and the repository will store

-

-24

-00:01:11,890 --> 00:01:15,570

-that information and make it available for other users. So now,

-

-25

-00:01:15,570 --> 00:01:18,290

-if Janet performs an update, she will get the

-

-26

-00:01:18,290 --> 00:01:21,860

-new version of foo.txt with the additional information that was

-

-27

-00:01:21,860 --> 00:01:24,950

-added by Brad. And we will see all of this

-

-28

-00:01:24,950 --> 00:01:27,350

-in action in our next demo in a few minutes.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/8 - "Don'ts" in VCS - lang_en_vs5.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/8 - "Don'ts" in VCS - lang_en_vs5.srt
deleted file mode 100644
index f5d27fb..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/8 - "Don'ts" in VCS - lang_en_vs5.srt
+++ /dev/null
@@ -1,175 +0,0 @@
-1

-00:00:00,100 --> 00:00:02,020

-Before getting to the demo, I want to say a few

-

-2

-00:00:02,020 --> 00:00:06,550

-more things. In particular, I discuss the main don'ts in VCS. So,

-

-3

-00:00:06,550 --> 00:00:09,110

-what are some things that you don't want to do, and

-

-4

-00:00:09,110 --> 00:00:12,687

-you should not do, when you're using a version control system? And

-

-5

-00:00:12,687 --> 00:00:15,382

-I'm going to mention two, in particular, because these are two

-

-6

-00:00:15,382 --> 00:00:18,028

-that I witnessed several times when I was teaching this class and

-

-7

-00:00:18,028 --> 00:00:21,820

-also when collaborating with other people. So, there are two kinds

-

-8

-00:00:21,820 --> 00:00:25,460

-of resources that you don't want to add to a VCS normally.

-

-9

-00:00:25,460 --> 00:00:29,070

-One is derived files. For example an executable that is

-

-10

-00:00:29,070 --> 00:00:31,930

-derived by compiling a set of source files, where the

-

-11

-00:00:31,930 --> 00:00:34,480

-source files all already in the repository. At that point,

-

-12

-00:00:34,480 --> 00:00:37,680

-there is no reason to also add the executable file in

-

-13

-00:00:37,680 --> 00:00:41,150

-the repository. So in general, any executable file should not

-

-14

-00:00:41,150 --> 00:00:44,570

-be added to repository. The second class of files that I

-

-15

-00:00:44,570 --> 00:00:47,760

-want to mention is these bulky binary files. If you

-

-16

-00:00:47,760 --> 00:00:50,600

-have one such file, it is normally not a good idea

-

-17

-00:00:50,600 --> 00:00:53,430

-to store them under a version control system, to store them

-

-18

-00:00:53,430 --> 00:00:56,670

-in the repository. There might be exceptions to these rules, but in

-

-19

-00:00:56,670 --> 00:00:59,070

-general, these are the kind of files that you want to

-

-20

-00:00:59,070 --> 00:01:02,540

-keep local, and you don't want to put in the VCS repository.

-

-21

-00:01:02,540 --> 00:01:06,500

-Another typical mistake, and that happens all the time, especially to

-

-22

-00:01:06,500 --> 00:01:10,650

-novice users of VCS. Is that you get your file from VCS

-

-23

-00:01:10,650 --> 00:01:13,120

-and so you get your local copy of the file that

-

-24

-00:01:13,120 --> 00:01:16,270

-was in the VCS, and you want to make some changes, and

-

-25

-00:01:16,270 --> 00:01:20,090

-before making the changes you decided, no, no let me actually save

-

-26

-00:01:20,090 --> 00:01:22,410

-a local copy of the file, and I'm going to work on

-

-27

-00:01:22,410 --> 00:01:24,950

-that one. Or let me save it before I modify it, or

-

-28

-00:01:24,950 --> 00:01:28,350

-let take a snap shot of a whole tree of files. Just because

-

-29

-00:01:28,350 --> 00:01:30,830

-I don't really trust the fact that VCS is going to be

-

-30

-00:01:30,830 --> 00:01:33,170

-able to help and is going to be able to recover from possible

-

-31

-00:01:33,170 --> 00:01:36,980

-mistakes. Never ever do that. I have seen that done many times,

-

-32

-00:01:36,980 --> 00:01:41,570

-and it always leads to disasters. First of all it is useless, and

-

-33

-00:01:41,570 --> 00:01:44,000

-second it's risky. Because then what happens is that at

-

-34

-00:01:44,000 --> 00:01:46,610

-the time in which you have to turn in your assignment,

-

-35

-00:01:46,610 --> 00:01:48,330

-in the case you are doing an assignment, but even in

-

-36

-00:01:48,330 --> 00:01:50,740

-more serious situation, when you have to turn in your code,

-

-37

-00:01:50,740 --> 00:01:54,620

-for example to your colleagues. You always end up being confused

-

-38

-00:01:54,620 --> 00:01:59,010

-about which is the version that you're really using. So absolutely

-

-39

-00:01:59,010 --> 00:02:03,262

-no local copies. No local redundancy when you're using a version

-

-40

-00:02:03,262 --> 00:02:06,798

-control system. Trust the version control system, and trust the version

-

-41

-00:02:06,798 --> 00:02:09,280

-control system to be able to manage your versions. You

-

-42

-00:02:09,280 --> 00:02:13,350

-can always save it, commit it, retrieve previous versions, and you'll

-

-43

-00:02:13,350 --> 00:02:15,530

-be able to do everything that you can do by copying

-

-44

-00:02:15,530 --> 00:02:19,240

-the file yourself, and even more. So again, try the VCS.

diff --git a/usth/ICT2.7/P1L4 Version Control Subtitles/9 - Two Main Types of VCS - lang_en_vs5.srt b/usth/ICT2.7/P1L4 Version Control Subtitles/9 - Two Main Types of VCS - lang_en_vs5.srt
deleted file mode 100644
index 3c6eba4..0000000
--- a/usth/ICT2.7/P1L4 Version Control Subtitles/9 - Two Main Types of VCS - lang_en_vs5.srt
+++ /dev/null
@@ -1,163 +0,0 @@
-1

-00:00:00,160 --> 00:00:01,970

-Something else I want to mention is that there

-

-2

-00:00:01,970 --> 00:00:05,460

-are many different version control systems but we can classify

-

-3

-00:00:05,460 --> 00:00:09,250

-them normally in two main types: centralized VCS's and

-

-4

-00:00:09,250 --> 00:00:13,230

-decentralized VCS's. So what is the difference between these two?

-

-5

-00:00:13,230 --> 00:00:16,750

-Let's use again our friends Janet and Brett.

-

-6

-00:00:16,750 --> 00:00:19,510

-In the case of a centralized version control system

-

-7

-00:00:19,510 --> 00:00:22,290

-there is a single centralized, as the name says,

-

-8

-00:00:22,290 --> 00:00:25,230

-repository. On which they are commiting their files. So when

-

-9

-00:00:25,230 --> 00:00:27,290

-Janet commits a file. The file will go from

-

-10

-00:00:27,290 --> 00:00:30,390

-her local working directory to the repository, and the same

-

-11

-00:00:30,390 --> 00:00:33,520

-will happen to Brett. The decentralized system is a little

-

-12

-00:00:33,520 --> 00:00:37,310

-more interesting because in this case, they will both have

-

-13

-00:00:37,310 --> 00:00:40,790

-sort of a local repository in which they can commit

-

-14

-00:00:40,790 --> 00:00:43,970

-their changes. So they can commit changes without the other

-

-15

-00:00:43,970 --> 00:00:47,940

-users of the VCS being able to see these changes.

-

-16

-00:00:47,940 --> 00:00:50,300

-And when they're happy with the version. And when they're

-

-17

-00:00:50,300 --> 00:00:53,900

-ready to release the version, they can push it to a central

-

-18

-00:00:53,900 --> 00:00:56,840

-repository. And at that point, it will become available to the other

-

-19

-00:00:56,840 --> 00:01:01,100

-users of the repository. To the other users of the VCS. There

-

-20

-00:01:01,100 --> 00:01:02,870

-are several advantages in a distributive

-

-21

-00:01:02,870 --> 00:01:04,300

-system. I'm just going to mention a few,

-

-22

-00:01:04,300 --> 00:01:07,520

-because there are really many. One is the fact of having this

-

-23

-00:01:07,520 --> 00:01:10,570

-local version. If you used VCS before, I'm sure you've been in

-

-24

-00:01:10,570 --> 00:01:13,280

-the situation in which you want to kind of take a snapshot

-

-25

-00:01:13,280 --> 00:01:15,820

-of what you have. But you don't want that snapshot to be available

-

-26

-00:01:15,820 --> 00:01:18,200

-to the other users. Because it's still not ready to be

-

-27

-00:01:18,200 --> 00:01:21,240

-released, to be looked up. If you're using a centralized system,

-

-28

-00:01:21,240 --> 00:01:23,140

-there's really no way you can do that, unless you make

-

-29

-00:01:23,140 --> 00:01:25,150

-a local copy, which is something we said you don't want

-

-30

-00:01:25,150 --> 00:01:28,625

-to do. With a distributor, with a decentralized VCS you can

-

-31

-00:01:28,625 --> 00:01:32,444

-commit your local changes here, in your local repository, and you

-

-32

-00:01:32,444 --> 00:01:37,030

-can push them to the central repository only when you're ready.

-

-33

-00:01:37,030 --> 00:01:40,870

-Another big advantage, is that you can use multiple remote repository.

-

-34

-00:01:40,870 --> 00:01:43,210

-In fact, centralized is not the right name for this

-

-35

-00:01:43,210 --> 00:01:45,980

-one. This is just a remote repository, and I can have

-

-36

-00:01:45,980 --> 00:01:48,910

-more than one. For example, Brad might want to push

-

-37

-00:01:48,910 --> 00:01:52,150

-to another remote repository. As well. For instance, this could be

-

-38

-00:01:52,150 --> 00:01:55,940

-a repository where the files are accessible for wider distribution.

-

-39

-00:01:55,940 --> 00:01:59,620

-Imagine developing a software system in which a team is sharing

-

-40

-00:01:59,620 --> 00:02:02,930

-internal versions, and then only some of these versions are actually

-

-41

-00:02:02,930 --> 00:02:06,080

-pushed to the repository that is seeable to the whole world.