1 Version Control

Version Control

Check this guide (opens in a new tab) to learn more about version control using Git.

Git

Git is a distributed version control system (DVCS) that tracks changes in any set of computer files, usually used for coordinating work among programmers who are collaboratively developing source code during software development. It was originally authored in 2005 for the development of the Linux kernel.1

There are other version control tools and systems such as Mercurial (opens in a new tab), Subversion (opens in a new tab), Helix (opens in a new tab), Sapling (opens in a new tab), Bazaar (opens in a new tab), and Team Foundation Server (opens in a new tab), each with specific and general use cases. Git is the most popular and is integrated into almost every IDE out there. A comprehensive list of GUI clients is available here (opens in a new tab).

Commands

A selection of porcelain Git commands with corresponding tutorials to get started:

A cheat sheet of Git commands from Atlassian is available here (opens in a new tab).

Collaboration

  1. Create a GitHub (opens in a new tab) account, if you do not have one already, and sign up for the GitHub Student Developer Pack (opens in a new tab).
  2. Install Git (opens in a new tab) and GitHub Desktop (opens in a new tab), if needed.
  3. Login with your GitHub credentials using GitHub Desktop/Visual Studio Code/IntelliJ IDEA.

Individual Repository

  1. Join the GitHub Classroom invitation (opens in a new tab) to create your individual private repository.
  2. Name your repository using the following format section-username-firstname, for example, b00-dd0123456-dane.
  3. Clone [git clone] your individual repository locally using GitHub Desktop/Visual Studio Code/IntelliJ IDEA.
  4. Stage [git add] your changes.
  5. Commit [git commit] your staged changes locally using a descriptive and concise message.
  6. Push [git push] your changes to sync them with the remote repository.
  7. Use this process to practice and push your weekly exercises.

Team Repository

  1. Join the GitHub Classroom invitation (opens in a new tab) to create/join your team private repository.
  2. Name your team repository using the following format team-teamname, for example, team-plasma.
  3. Clone [git clone] your team repository locally using GitHub Desktop/Visual Studio Code/IntelliJ IDEA.
  4. Fetch [git fetch] to receive the latest changes.
  5. Pull [git pull] to apply the changes to your working copy.
  6. Stage [git add] your changes.
  7. Commit [git commit) your staged changes locally using a descriptive and concise message.
  8. Push [git push] your changes to sync them with the remote repository.
  9. Use this process to collaborate on your project.

You must push before deadlines as commit dates can be overridden using git commit --date="YYYY-MM-DD HH:MM:SS".

Workflows

We will be using the centralized workflow for the project, but feel free to explore other workflows and mix and match them to suit your preferences.

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” —Martin Fowler (opens in a new tab)

Resources

Footnotes

  1. Git (opens in a new tab)

  2. Gitflow (opens in a new tab)