# -*- mode: org -*-
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../css/emacs.css" />

* What is Source Control?
[[file:../../../_images/cuties/team.png]]

Software companies usually have tens or even hundreds of developers working together on a product or products. They need to have an efficient way to merge their code together, as well as have the tools to do code reviews, make backups, and check past versions of code files. A Source Control (aka Version Control) solution gives us features for all of these.

Git and TFS are probably the most popular solutions currently in use, and some others include SVN and Mercurial. They each function somewhat differently, but share a lot of the same concepts. For our class we will be using Git.

* Repositories
[[file:../../../reference/images/gitquiz-repositories.png]]

A Repository is basically like a single "Project". You might have multiple repositories for different projects, or a company might have multiple repositories for different software products.

A Git Repository is set up so that Git takes care of tracking changes over time, create branches to work on new features, automatically merge changes with other people, and more.

* Commit log
[[file:../../../reference/images/gitquiz-commitlog.png]]

Git keeps track of changes made by different developers over time. Each time we use the commit command, a "snapshot" of our changes are made. Once synced to the GitLab server, we can see a list of all commits in the history of the project.

* Git blame
[[file:../../../reference/images/gitquiz-commitlog2.png]]

If we click on a commit, we can view a log of which lines of code were changed - red for "removed", + green for "added".

* Git vs. GitLab
[[file:../../../reference/images/gitquiz-gitvsgitlab.png]]

- Git itself is a whole system that facilitates this organized software development.
- GitLab is a service that provides hosting for Git repositories. (GitHub is another common example.)
- Each developer installs the Git software to their computer, which allows them to communicate to the repository's server with basic action commands.

