HomeAbout

Git

What is it

index is a place where you prepare your changes before committing them (before commit, you add the files to the index)

  • index is also known as cache, directory cache, current directory cache, staging area, staged files

What is a Working Tree

Working tree are the files that you are currently working on

  • git add moves the modifications in the working tree to the index

Who is who in Git

Let's take a case of rebasing from a local feature to a remote main.

HEAD vs commit

Let's say you're rebasing a main branch onto your currently working WIP branch:

  • HEAD is the upstream main branch
  • feat commit would be your current WIP branch.

us vs them

us vs them

  • us represents upstream which is the branch you are merging into.
  • them represents the branch to be merged.

Git cherry-picks your changes into the upstream branch when running rebase.

  • us = into = upstream main = HEAD
  • them = from = WIP = feat commit
AboutContact