1 Version Control

Version Control

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

Git

Git s 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

Commands

  1. git init
  2. git clone
  3. git add
  4. git commit
  5. git push
  6. git fetch
  7. git pull
  8. git diff
  9. git status

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 or Visual Studio Code.

Class Repository

  1. Clone [git clone] the class public repository (opens in a new tab) using GitHub Desktop or Visual Studio Code.
  2. Fetch [git fetch] to receive the latest changes.
  3. Pull [git pull] to apply the changes to your working copy.
  4. Repeat this process periodically to keep your local repository synchronized with the remote one; at least once at the beginning of every lab session.

Personal Repository

  1. Join the GitHub Classroom invitation (opens in a new tab) to create your personal private repository.
  2. Clone [git clone] your repository locally using GitHub Desktop or Visual Studio Code.
  3. Stage git add your changes.
  4. Commit [git commit] your staged changes locally using a descriptive and concise message.
  5. Push [git push] your changes to sync them with the remote repository.
  6. Use this process to push your labs, assignments, and exams.

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

Resources

Footnotes

  1. Git (opens in a new tab)