Before getting to the demo, I want to say a few
more things. In particular, I discuss the main don'ts in VCS. So,
what are some things that you don't want to do, and
you should not do, when you're using a version control system? And
I'm going to mention two, in particular, because these are two
that I witnessed several times when I was teaching this class and
also when collaborating with other people. So, there are two kinds
of resources that you don't want to add to a VCS normally.
One is derived files. For example an executable that is
derived by compiling a set of source files, where the
source files all already in the repository. At that point,
there is no reason to also add the executable file in
the repository. So in general, any executable file should not
be added to repository. The second class of files that I
want to mention is these bulky binary files. If you
have one such file, it is normally not a good idea
to store them under a version control system, to store them
in the repository. There might be exceptions to these rules, but in
general, these are the kind of files that you want to
keep local, and you don't want to put in the VCS repository.
Another typical mistake, and that happens all the time, especially to
novice users of VCS. Is that you get your file from VCS
and so you get your local copy of the file that
was in the VCS, and you want to make some changes, and
before making the changes you decided, no, no let me actually save
a local copy of the file, and I'm going to work on
that one. Or let me save it before I modify it, or
let take a snap shot of a whole tree of files. Just because
I don't really trust the fact that VCS is going to be
able to help and is going to be able to recover from possible
mistakes. Never ever do that. I have seen that done many times,
and it always leads to disasters. First of all it is useless, and
second it's risky. Because then what happens is that at
the time in which you have to turn in your assignment,
in the case you are doing an assignment, but even in
more serious situation, when you have to turn in your code,
for example to your colleagues. You always end up being confused
about which is the version that you're really using. So absolutely
no local copies. No local redundancy when you're using a version
control system. Trust the version control system, and trust the version
control system to be able to manage your versions. You
can always save it, commit it, retrieve previous versions, and you'll
be able to do everything that you can do by copying
the file yourself, and even more. So again, try the VCS.