GitVibes / Enterprise Onboarding
Part 1

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.

Your identity is baked into every commit — configure it once and forget about it
Note
The Problem: You have a new machine with a fresh Git installation. Before your first commit, Git requires you to set your identity -- a permanent digital signature baked into every change you make.

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.

Set your identity
git config --global user.name "Your Name"
git config --global user.email "your-enterprise-email@company.com"
Tip
The --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:

Verify your config
git config user.name          # One value
git config --global --list    # Everything you've set globally

While you're here, four more one-time settings pay for themselves many times over:

Quality-of-life defaults
# 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 true

Try 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.

Every commit records who made it. This sandbox only knows the default identity — run 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.
Introduce Yourself to Git

Loading playground...

Vibe it

"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.

A personal access token proves your identity to GitHub without a password
Warning
The Problem: Your company's code is in a private repository, and password authentication for Git operations no longer exists. You need either a Personal Access Token (for HTTPS) or an SSH key — and you should know which one fits your situation.

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:

  1. Go to GitHub SettingsDeveloper settingsPersonal access tokensFine-grained tokens
  2. Click Generate new token and name it descriptively (e.g., "Work Laptop")
  3. Set an expiration (90 days recommended)
  4. Under Repository access, choose Only select repositories and pick your project
  5. Under Permissions, set Contents to Read and write
  6. Click Generate token and copy it immediately — you won't see it again
Note
Some organizations still use the older classic tokens (same page, under "Tokens (classic)" — select the 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.
Clone using your token
git clone https://github.com/Your-Enterprise/your-project.git
# Username: your-github-username
# Password: your-personal-access-token

Storing Your Credentials

Save credentials (choose your OS)
# 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 cache
Tip
On macOS and Windows a helper is usually already configured by the installer — run these only if Git keeps re-prompting for your token. On Linux there's no default: install Git Credential Manager (or use cache). 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.

Generate your key
ssh-keygen -t ed25519 -C "your-enterprise-email@company.com"
# Press Enter to accept the default file location,
# then choose a passphrase (recommended)
Add the key to the ssh-agent
# 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
Caution
Make it survive a reboot (macOS): without a config file, the agent forgets your key when you restart — and SSH auth mysteriously breaks days later. Create ~/.ssh/config with the lines below (on Linux, drop the UseKeychain line):
~/.ssh/config — load the key automatically
Host *
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_ed25519
Copy your public key
# 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.pub

Then go to GitHub SettingsSSH and GPG keysNew SSH key, paste the key, and save. Verify the connection works:

Test the connection
ssh -T git@github.com
# Hi your-username! You've successfully authenticated...
Important
Only ever share the .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:

Clone over SSH
git clone git@github.com:Your-Enterprise/your-project.git
# No username or token prompt - your key authenticates you

Which One Should You Use?

Tip
SSH if it's your own machine and you push daily — one-time setup, then it disappears from your life. A fine-grained token for scripts, CI pipelines, or short-lived access to a specific repo. Or let a tool set one of those two up for you — browser sign-in (below) stores an HTTPS token behind the scenes, no copy-pasting required.

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:

Install GitHub CLI
# macOS
brew install gh

# Windows
winget install --id GitHub.cli

# Linux - see cli.github.com for your distro's instructions

Then one command handles the entire authentication setup interactively — including generating and uploading an SSH key if you ask it to:

Authenticate once, interactively
gh auth login
# Pick HTTPS or SSH, sign in through your browser,
# and it configures Git for you
Tip
Once gh 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:

VS Code
VS Code automatically opens your browser to sign in to GitHub -- no tokens to manage.
Warning
The enterprise wall: SAML SSO authorization. In most companies on GitHub Enterprise Cloud, a working token or SSH key is not enough — it must also be explicitly authorized for your organization, or every clone fails with the famously misleading 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.
Vibe it

"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.

Cloning creates a complete copy of the remote repository on your machine
Note
The Problem: The code exists on the server, but not on your machine. You need to download a complete copy ("clone") of the repository.

To get a copy of the project on your machine, run the clone command with the repository URL your team shared with you:

Clone the repository
git clone https://github.com/Your-Enterprise/your-project.git
cd your-project   # The clone lands in a NEW folder named after the repo

That 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

  1. Open VS Code. Click "Clone Repository" on the Welcome page
  2. Or use the Command Palette (Cmd+Shift+P / Ctrl+Shift+P) and type Git: Clone
  3. Paste the HTTPS URL. VS Code handles authentication automatically
  4. Choose a save location, then open the folder
VS Code
Use Cmd+Shift+P → 'Git: Clone' and paste the repository URL. VS Code handles the rest.

One thing to keep in mind after cloning:

Note
When you clone, you only get the default branch (e.g., main) checked out. Other branches exist as remote-tracking branches until you explicitly check them out.
Warning
If you see a .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.
Vibe it

"Clone the repo at github.com/our-team/project into my projects folder"

"Clone this repository and set up the development environment"

Challenge: Sign Your Work

Loading challenge...