Git Introduction

About Version Control

Why we have Version Control?

Centralized vs. Decentralized

  1. Centralized:

    • Single truth

    • Simple revision numbers

    • Timeline is always straight

    • Single point of failure

    • Simpler branches

    • Small number of branches

  2. Decentralized

    • Unable to use incremented int as revision numbers

    • Use hashes

    • All repositories are equal

    • Any repository can have different history

    • More diverged branches

    • Can have many branches

Design Philosophy

  1. Tracking file permissions

  2. Tracking file renames and moves

  3. Key-Value Storage of Immutable Objects

  4. Working Offline

  5. Efficient Storage

Use Cases

Assignments

SSH key

  1. Create and login to Github account

  2. If you don’t have .ssh/id_rsa lub .ssh/id_rsa.pub run command ssh-keygen

  3. Add your.email@example.com/hostname to the end of your public key ~/.ssh/id_rsa.pub (as a comment)

  4. Add ssh public key ~/.ssh/id_rsa.pub to Github profile

Repository Hosting

  1. create accounts

  2. create repo

  3. protect branches

  4. add collaborators

  5. clone & touch .gitignore & push

  6. pull-request