DCubes
Git module

Lesson 5

clone and navigate

Clone a repository URL and move through history with log and show.

beginner25 minRun on your machine

What you will be able to do

  • Explain clone vs init
  • Use git log and git show
  • Copy a local repo with git clone

Why this matters for data work

You rarely start from zero at work — you clone the team repo. Locally, cloning your own lab repo practices the same commands.

Concepts

  • git clone <url> [dir] — copy a repo including history
  • git show <commit> — patch and metadata
  • git log --oneline --graph — shape of history

Practice on your machine

Clone the local demo as if it were remote (path clone):

cd ~/dcubes/git-lab
git clone ./init-demo init-demo-clone
cd init-demo-clone
git log --oneline
git show HEAD
ls -a

What you should see

  • Full file set from init-demo.
  • Same commits in log.
  • .git present in the clone.

Common mistakes

  • Cloning into a non-empty directory accidentally.
  • Editing the bare remote — path clones of non-bare repos are for labs only; GitHub is next.

Next

Branches