Cloning and Understanding What You Got
A real team repo, cloned for the first time. Map its entire real history before touching anything.
This is a genuinely different starting point than every earlier lesson: instead of continuing your own local ~/recipes, you clone the team's shared repository fresh, exactly as any new teammate would on their first day. Other real contributors have already been at work — real branches, real commits, real feature work in progress.\n\nBefore writing a single line, the real, disciplined move is to map out what you actually have: which branches exist only on the remote, what HEAD is pointing to, and how your local master compares to origin/master. git log --all --graph turns a confusing pile of unfamiliar history into a real, readable picture in one command.
Cloning a Real, Existing Project
git clone ~/recipes-origin.git ~/team-recipes
A genuine full copy: every commit, every branch the remote knows about, arrives in one step — not just whatever master happens to contain.
Which Branches Are Actually Local?
cd ~/team-recipes && git branch -a
Only master gets a real local branch automatically. feature/dessert-menu and hotfix/soup-typo exist as real remote-tracking references (remotes/origin/...) — visible, inspectable, but not yet something you can commit onto directly.
Mapping the Real History
git log --oneline --all --decorate --graph
--all shows every branch's real history at once, not just the checked-out one — the single most useful first command in any unfamiliar repository.
Where You Actually Are
cat .git/HEAD
git rev-parse master origin/master
Immediately after a fresh clone, master and origin/master genuinely point at the exact same commit — you are, for this one moment, perfectly caught up.
Remote-tracking branch
A real, local reference (like origin/feature-x) recording a branch's state on the remote, created automatically for every branch a clone or fetch discovers. Confirmed directly in this lab: feature/dessert-menu and hotfix/soup-typo appeared as remotes/origin/... entries, with no local branch of the same name yet.
git log --all
Shows history for every ref git knows about — every local branch, every remote-tracking branch — rather than only the currently checked-out one. Confirmed directly in this lab revealing two entirely separate lines of work invisible to a plain git log.
📥 Clone the Real Team Repository
Clone the team's shared repo for the first time, exactly as a new teammate would.
git clone ~/recipes-origin.git ~/team-recipesstudent@lab:~$ git clone ~/recipes-origin.git ~/team-recipes Cloning into '/home/student/team-recipes'... done.
🌿 See Which Branches Are Actually Local
List every branch git knows about, and spot which ones are remote-only.
cd ~/team-recipes && git branch -astudent@lab:~$ cd ~/team-recipes && git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/feature/dessert-menu remotes/origin/hotfix/soup-typo remotes/origin/master
🗺️ Map the Entire Real History
See every branch's real history in one view, exactly as it actually happened.
cd ~/team-recipes && git log --oneline --all --decorate --graphstudent@lab:~$ cd ~/team-recipes && git log --oneline --all --decorate --graph * b6b719c (origin/hotfix/soup-typo) Note serving size in soup recipe | * 390d424 (origin/feature/dessert-menu) Add panna cotta recipe | * 5a42f5c Add tiramisu recipe |/ * 5062570 (HEAD -> master, origin/master, origin/HEAD) Merge remote-tracking branch 'origin/master' |\ | * 8634076 Add banana bread recipe * | dd878a3 Add iced coffee recipe |/ * dfca8a1 Stop tracking db-credentials.txt * bd7db64 Add database credentials * a980dbd Add .gitignore for local clutter and secrets * 81d9759 Add taco and salsa recipes * 6293056 Add scrambled eggs recipe * 0f17cc4 Document branch naming convention * 5997d5c Add serving note to cookie recipe * 7451729 Increase butter back to 175g for a richer flavor * 59cee07 Reduce butter to 150g per taste-test feedback * 22779d0 Add butter quantity to cookie ingredients * 9db68e6 Add variations note to cookie recipe * dda949a Credit the recipe source in the cookie title * c7a2617 Add step-by-step instructions to cookie recipe * 8c8aee6 Add Belgian waffles recipe * 5856011 Add basic garden salad recipe * fd509ba asdf * c764cd9 Add prep time estimates to all three recipes * 1aa939c Add salt to taste note in soup recipe * 56c4ee4 fixed stuff * b5dba00 Add chicken noodle soup recipe * cd7e65b Add ingredients list and pasta recipe * 7fb33b3 Add chocolate chip cookie recipe
📍 Confirm Where You Actually Are
Check what HEAD points to, and confirm master and origin/master genuinely match right now.
cd ~/team-recipes && cat .git/HEADcd ~/team-recipes && git rev-parse master origin/masterstudent@lab:~$ cd ~/team-recipes && cat .git/HEAD ref: refs/heads/master student@lab:~$ cd ~/team-recipes && git rev-parse master origin/master 5062570cea06b91050cd5a54bdc6bf464fd24d19 5062570cea06b91050cd5a54bdc6bf464fd24d19
Lab 2.1.1 complete. A real team project, cloned and fully mapped before touching anything:\n\n\n Real repo cloned : ✅ ~/team-recipes\n Remote-only branches spotted : ✅ two real feature branches\n Full history mapped : ✅ git log --all --graph\n HEAD and sync confirmed : ✅ master == origin/master\n
Enable JavaScript to run the live terminal and track your progress.