Skip to content
EgyKode
01 · FoundationsLab 6 / 59
Guided labgit

Git Branching & Collaboration

Work a change through a branch, a rebase and a conflict, and recover from the three mistakes everyone makes.

Time
45 min
Level
Beginner
Objectives
4 objectives
Cost
Free

Where this fits in the platform

Already built

This lab adds

  • A repository you can branch and merge without fear

Before you start

You will need

  • git 2.30+
  • a GitHub account

You do not need these already — the lab environment below provides them.

You will be able to

  • Take a change from branch to merged pull request
  • Rebase onto a moved main and resolve a conflict deliberately
  • Recover a commit you thought you destroyed
  • Remove a secret from history, and know why that is not enough

CostFree

— a GitHub account is enough

Nothing to pay in the browser. Open the terminal runs this against a simulated cloud — the same API calls and the same commands, with no account and no bill. The figure above applies only if you build it in your own.

The scenario#

You are contributing to a repository other people are also changing. Main has moved since you branched, your history has a conflict in it, and at some point you will reset something you did not mean to.

All three are normal. None of them should cost you work.

Hands-on environment

Run this lab in a real terminal, free and in your browser. The environment is temporary and yours alone — break it as much as you like.

Open the terminal

Opens in Killercoda, in a new tab — keep this page open for the steps.

Run it on your own machine

Run this lab on your own machine. One command starts the environment, with everything the lab needs already installed:

You will need:

  • git
git clone https://github.com/EgyKode/EgyKode-lab.git
cd EgyKode-lab
./egykode start
./egykode shell

You need Docker and Git installed. Everything else runs inside the environment. The first start downloads it and takes a few minutes; later starts are seconds.

Not sure what you already have? Run: npm run doctor — it checks and changes nothing.

Anything you tick here is your own record. EgyKode cannot see inside that terminal, so the success criteria stay self-assessed even when the environment checks your work for you.

The daily loop

Step 1 of 4

Success criteria

0 of 4

The concept behind it

Ready to try it without help?Do the challenge

Next up

Lab 6 of 59 on the project path

Git Recovery & History SurgeryDestroy work four different ways and get it back, then remove a secret from history and understand why that is not the fix.Why next: A repository you can branch and merge without fear45 minIntermediate

Previous: Bash Automation: A Script You Can Trust