Enterprise Onboarding: Connecting to Your Codebase
"Every great journey begins with a single git clone." Before you write your first line of code — or prompt your first AI — you need Git set up and
talking to your team's repository. This is a one-time ritual: configure your identity,
authenticate, and clone. Do it once and it mostly stays done (expiring tokens are the one
exception — SSH keys and gh sign-in are the true set-and-forget paths).
1.1 First-Time Local Configuration
Every commit you make carries a name and email — your digital signature. Before anything else, Git needs to know who you are.
In an enterprise, traceability is paramount. Every commit must be tied to a specific individual. Using your correct enterprise name and email is non-negotiable.
git config --global user.name "Your Name"
git config --global user.email "your-enterprise-email@company.com"--global flag saves this for every Git repository on your computer. You only
need to do this once.Don't want to use the terminal? No problem. VS Code will prompt you to configure your identity the first time you commit — answer the prompt and it runs those two commands for you. (There's no palette command for this; the prompt or the terminal are the two paths.)
To see what's already configured — or double-check what you just set — read it back:
git config user.name # One value
git config --global --list # Everything you've set globallyWhile you're here, four more one-time settings pay for themselves many times over:
# New repos start on 'main' (matches GitHub; becomes Git's own
# built-in default in Git 3.0)
git config --global init.defaultBranch main
# Git messages open in VS Code instead of a terminal editor
git config --global core.editor "code --wait"
# First push of a new branch just works - no upstream error
git config --global push.autoSetupRemote true
# When you pull into local commits, replay yours on top
# (you'll meet the alternative in Part 3)
git config --global pull.rebase trueTry It: Introduce Yourself to Git
Meet your constant companion for the rest of this course: the Git Playground — a real Git repository running entirely in your browser. Nothing you type here can touch your actual machine, and most lessons from here on end with one of these, so you can practice each concept the moment you learn it. First exercise: the config commands you just read.
git config user.name "Your Name" (and user.email),
then commit the waiting file and check git log: the save point now carries
your name. A ✔ appears when the log credits someone other than the default.Loading playground...
"Set up my Git config with my name and email on this machine"
"Configure Git to use VS Code as my default editor"
1.2 Authentication: Tokens & SSH Keys
Your company's code lives in a private repository. To access it, you need to prove you're allowed in — and GitHub removed password authentication for Git back in 2021. Today there are two ways to authenticate: over HTTPS with a token, or over SSH with a key pair.
Option 1: HTTPS with a Personal Access Token
A Personal Access Token (PAT) is a generated secret that acts as your password, but with scoped permissions and an expiration date. GitHub now recommends fine-grained tokens, which can be limited to specific repositories:
- Go to GitHub Settings → Developer settings → Personal access tokens → Fine-grained tokens
- Click Generate new token and name it descriptively (e.g., "Work Laptop")
- Set an expiration (90 days recommended)
- Under Repository access, choose Only select repositories and pick your project
- Under Permissions, set
Contentsto Read and write - Click Generate token and copy it immediately — you won't see it again
repo scope; add read:org only if you'll also sign in the gh CLI with it). If your team tells you
to use one, the rest of the workflow is identical.git clone https://github.com/Your-Enterprise/your-project.git
# Username: your-github-username
# Password: your-personal-access-tokenStoring Your Credentials
# macOS - usually preconfigured to use the Keychain; if not:
git config --global credential.helper osxkeychain
# Windows - Git for Windows ships with Credential Manager; if not:
git config --global credential.helper manager
# Linux - install Git Credential Manager (git-credential-manager),
# then:
git config --global credential.helper manager
# Lightweight alternative (holds credentials in memory ~15 min):
git config --global credential.helper cachecache). You may see older guides suggest libsecret — on Debian/Ubuntu that helper ships as source code you'd have to compile first, so it fails out
of the box. Once a helper is set, Git prompts you once and saves the credentials.Option 2: SSH Keys
SSH flips the model. Instead of pasting a secret, you generate a key pair: a private key that never leaves your machine, and a public key you upload to GitHub. Set it up once and every clone, pull, and push just works — no tokens to renew. It's the classic "set it and forget it" choice for a machine you develop on daily.
ssh-keygen -t ed25519 -C "your-enterprise-email@company.com"
# Press Enter to accept the default file location,
# then choose a passphrase (recommended)# macOS - store the passphrase in your Keychain
eval "$(ssh-agent -s)"
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
# Windows (Git Bash) & Linux
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519~/.ssh/config with the lines below (on Linux, drop the UseKeychain line):Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519# macOS
pbcopy < ~/.ssh/id_ed25519.pub
# Windows (Git Bash)
cat ~/.ssh/id_ed25519.pub | clip
# Linux - print it, then copy the output
cat ~/.ssh/id_ed25519.pubThen go to GitHub Settings → SSH and GPG keys → New SSH key, paste the key, and save. Verify the connection works:
ssh -T git@github.com
# Hi your-username! You've successfully authenticated....pub file. The private key (the one without an extension)
must never leave your machine — treat it like the master key to your accounts.With SSH, repository URLs look different — use the SSH tab of the green Code button when copying a clone URL:
git clone git@github.com:Your-Enterprise/your-project.git
# No username or token prompt - your key authenticates youWhich One Should You Use?
The Modern Shortcut: GitHub CLI
In practice, many developers today never copy a token at all. The GitHub CLI (gh) is GitHub's official command-line tool. Where git talks to the repository, gh talks to GitHub itself — authentication, pull requests, issues, releases — all without leaving
your terminal. Download it from cli.github.com or install it with your package manager:
# macOS
brew install gh
# Windows
winget install --id GitHub.cli
# Linux - see cli.github.com for your distro's instructionsThen one command handles the entire authentication setup interactively — including generating and uploading an SSH key if you ask it to:
gh auth login
# Pick HTTPS or SSH, sign in through your browser,
# and it configures Git for yough auth login succeeds, every git clone, pull, and push just works — and you get bonus commands like gh pr create to open a pull request straight from your terminal.And if you're using VS Code, it handles GitHub authentication the same way — when you clone a private repo or push for the first time, it opens your browser to sign in. No tokens to generate, copy, or store:
repository not found (the repo exists; your credential just isn't SSO-blessed). The fix takes ten seconds: GitHub → Settings → your token or SSH key → "Configure SSO" → Authorize for your org. If day
one at a new job ends in ERROR: Repository not found, check this before anything else."Generate an ed25519 SSH key and add it to my GitHub account"
"Help me decide between SSH and a personal access token for this machine"
1.3 Getting the Code (Cloning the Repository)
Your team's code exists on a remote server. Cloning is the act of bringing the entire project — every file, every branch, every commit in its history — right onto your machine.
To get a copy of the project on your machine, run the clone command with the repository URL your team shared with you:
git clone https://github.com/Your-Enterprise/your-project.git
cd your-project # The clone lands in a NEW folder named after the repoThat new folder is the repository — specifically, the hidden .git directory inside it holds the entire history, every branch, all of it. Delete .git and you're left with an ordinary folder of files. (And the #1 "Git is broken!" beginner moment:
running git commands from the parent folder — check you actually cd'd in.)
The VS Code Way
- Open VS Code. Click "Clone Repository" on the Welcome page
- Or use the Command Palette (Cmd+Shift+P / Ctrl+Shift+P) and type Git: Clone
- Paste the HTTPS URL. VS Code handles authentication automatically
- Choose a save location, then open the folder
One thing to keep in mind after cloning:
main) checked out.
Other branches exist as remote-tracking branches until you explicitly check them out..gitmodules file, stop and read this. The repo uses submodules — other Git repositories pinned inside this one. A plain clone
leaves those directories empty; you need git clone --recurse-submodules <url> (or, after the fact, git submodule update --init --recursive). Two rules until you've studied
them properly: don't hand-edit inside a submodule directory, and watch AI agents around them
— a careless git add . can silently commit a moved submodule pointer, which is a notorious
way for agents to break builds."Clone the repo at github.com/our-team/project into my projects folder"
"Clone this repository and set up the development environment"
Loading challenge...