Introduction to version control

Introduction to Git

George Boorman

Curriculum Manager, DataCamp

What is version control?

  • Processes and systems to manage changes to files, programs, and directories

Flow charts and checklists depicting the management of files and programs

Introduction to Git

What should be version controlled?

  • Version control is useful for anything that:
    • changes over time, or
    • needs to be shared

Image of a laptop with python code on display

Introduction to Git

What can version control do?

  • Track files in different states
  • Combine different versions of files
  • Identify a particular version
  • Revert changes
Introduction to Git

Why is version control important?

Preparing food on a chopping board with other ingredients in bowls

1 Image credit: https://unsplash.com/@mvdheuvel
Introduction to Git

Why is version control important?

Website with a bug

Introduction to Git

Introducing Git

Image of the Git logo

  • Popular version control system for software development and data projects
  • Open source
  • Scalable
Introduction to Git

Benefits of Git

  • Git stores everything, so nothing is lost
  • We can compare files at different times
  • See what changes were made, by who, and when
  • Revert to previous versions of files!

Road sign showing a U-turn

1 Image credit: https://unsplash.com/@wilsonjim
Introduction to Git

Using Git

  • Git commands are run on the shell, also known as the terminal
  • The shell:
    • is a program for executing commands
    • can be used to easily preview or inspect files and directories

 

  • Directory = folder

Picture of the terminal logo

 

 

Two folders called Documents and Mental Health in Tech Project

Introduction to Git

Useful terminal commands

pwd
/home/repl/Documents
ls
archive    finance.csv    finance_data_clean.csv    finance_data_modified.csv
Introduction to Git

Changing directory

cd archive
pwd
/home/repl/Documents/archive
Introduction to Git

Checking Git version

git --version
git version 2.46.0
Introduction to Git

Let's practice!

Introduction to Git

Preparing Video For Download...