Git
What is a Working Tree
Working tree are the files that you are currently working on that has not been added to the index.
git addmoves the modifications in the working tree to theindex.
index
index is a place where you prepare your changes before committing them (before commit, you add the files to the index)
indexis also known ascache,directory cache,current directory cache,staging area,staged files
Who is who in Git
Let's take a case of rebasing from a local feature to a remote main branch.
HEAD vs commit
Let's say you're rebasing a main branch onto your currently working WIP branch:
HEADis the upstreammainbranch.feat commitwould be your currentWIPbranch.
us vs them
us vs them
usrepresentsupstreamwhich is the branch you are merging into.themrepresents the branch to be merged.
Git cherry-picks your changes into the upstream branch when running rebase.
us=into= upstreammain=HEADthem=from=WIP=feat commit