learn-terraform

Course outlines for learning terraform.

View the Project on GitHub robertdebock/learn-terraform

Using GIT for version control.

expected time requirements
60 minutes A browser.

Goal: Learn to work with Git.

Explanation

You can write code on your laptop or a shared (bastion/jump) server. Without a version control system system, it’s difficult to work together, track changes, understand who has done what and many other issues.

Using a version control system is sort of required when writing code.

“If it’s not in git, svn or cvs, it does not exist.”

Introduction

Git is a version control system. Alternatives are:

Howto

Here is what I do to setup a new repository.

git init
git add .
git commit -m "Initial commit."

When the code is sort of ready, I’ll create a repository on GitHub and push the code.

git remote add origin https://github.com/robertdebock/bla.git
git push -u origin master

By now CI/CD tests the code and it’s never occurred to me that the code was flawless the first attempt. So, fix the issue, try again.

git add .
git commit -m "Fix something."
git push

Some commands can be combined: git add . and git commit -m "Fix something." can be combined: git commit -am "Fix something."

When contributions happen, I’ll merge it online, but have to remember to pull.

git pull

Demo

Assignment

Bonus assignment

You’re done when you can use these commands: (Likely scenario 1, 2 and 3.)

An explanation on Git if you’ve got time to spare.

Questions

  1. What is the difference between git and GitHub or GitLab?
  2. Can you explain what git fetch, git merge, git pull do?
  3. git and CI/CD are commonly used together, do you know the differences?