skipnothing/Git
UNIT 05

Collaboration

Remotes, pull requests, hooks, and team workflows

Git was designed for distributed collaboration. Remotes, pull requests, and workflows turn individual repositories into team tools.

Loading…
BUILDS ON
TOPICS
#16

Remotes

Watch `git remote add` write two lines to `.git/config` with no network call, see `git fetch` fill `.git/objects/` and `refs/remotes/origin/` while your branches stay put, and read a `non-fast-forward` push rejection as the remote refusing to drop a teammate's commit.

You clone a coworker's repo, add their URL, and expect a live wire to their machine. Open `.git/config` instead: two text lines got written, and no connection was ever opened.

14 min
#17

Pull Requests

Search the server's `.git/` after opening a PR and find no new object, push more commits to see the diff re-resolve off the live tip with no update step, then run merge, squash, and rebase to land `refs/heads/main` at three different hashes.

You've clicked the green Merge button and watched your branch fold into `main`. Now grep the whole `.git/` folder for that button, the object store, the refs, the config, every command git ships, and it isn't there.

12 min
#18

Git Hooks

Place a file named `pre-commit` in `.git/hooks/`, `chmod +x` it, and watch git fork it on the next commit and abort on a non-zero exit, then clone the repo to find the hook gone and see why `--no-verify` skips your copy but never the server's `pre-receive`.

You run `git commit` and it just works, every time. Then one day it stops, refuses, and prints a line you wrote yourself, because a plain script sitting in `.git/hooks/` returned a number git did not like.

10 min
#19

Workflows

Read a team's model off its `git branch -a`, route one feature through trunk-based, GitFlow, and forking so identical code lands on `main` three ways, then pick the shape by release cadence and contributor trust.

Two teams, two printouts of `git branch -a`: one is a single line, the other a dozen. Same git binary, the same objects underneath, so the difference is a shape each team chose, not a feature git turned on.

12 min
All units