9/56
Sign inSign up free

790. Work and Personal Git Identities

medium 20 XP ~7 minHands-on lab

You use this machine for both open-source work and your job at initech. Commits in ~/work/ must use your company identity, everything else your personal one. Last week a commit to a company repo went out as student@brokencluster.local.

Task

Configure Git for user student so that:

  • by default, commits use Sam Student <sam@personal.example>,
  • in any repository under /home/student/work/ (existing or future), commits use Sam Student <sam.student@initech.example>,
  • the work settings live in a separate file, /home/student/.gitconfig-work, that ~/.gitconfig includes conditionally.

Don't put identity settings into the individual repositories' own config.

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.