Every task on its own branch
Teams do not push straight to main: each task gets its own branch. git switch -c add-contact creates the branch and moves HEAD to it. With the commit, the branch moves to b4efc3f; main stays put.
Teams do not push straight to main: each task gets its own branch.
git switch -c add-contact creates the branch and moves HEAD to it.
With the commit, the branch moves to b4efc3f; main stays put.
Teams do not push straight to main: each task gets its own branch. git switch -c add-contact creates the branch and moves HEAD to it. With the commit, the branch moves to b4efc3f; main stays put.
git push -u origin add-contact copies the commit and creates the branch on GitHub.
-u links it to origin/add-contact: after that, git push is enough.
git push -u origin add-contact copies the commit and creates the branch on GitHub. -u links it to origin/add-contact: after that, git push is enough.
A Pull Request asks to merge your branch: base main, compare add-contact.
Open it with Compare & pull request or gh pr create; the team reviews there.
A Pull Request asks to merge your branch: base main, compare add-contact. Open it with Compare & pull request or gh pr create; the team reviews there.
Ben asks for a menu link; Ana commits on the same branch and runs git push.
The PR follows the branch, not a commit: 330bf8b shows up right away.
Ben asks for a menu link; Ana commits on the same branch and runs git push. The PR follows the branch, not a commit: 330bf8b shows up right away.
Ben's PR was merged: main moved and the PR warns of a conflict.
git fetch brings them and moves origin/main; your files stay intact.
git merge origin/main joins them, but both changed the menu: conflict.
Ben's PR was merged: main moved and the PR warns of a conflict. git fetch brings them and moves origin/main; your files stay intact. git merge origin/main joins them, but both changed the menu: conflict.
Ana keeps both links, Blog and Contact, and deletes the markers.
git commit --no-edit creates the merge commit cb26567, with two parents.
After git push the PR has no conflicts: fixed on your branch.
Ana keeps both links, Blog and Contact, and deletes the markers. git commit --no-edit creates the merge commit cb26567, with two parents. After git push the PR has no conflicts: fixed on your branch.
Ben approves and GitHub merges it: 29d937d lands on main.
Your main lacks it: git switch main and git pull fast-forward it.
Ben approves and GitHub merges it: 29d937d lands on main. Your main lacks it: git switch main and git pull fast-forward it.
git branch -d deletes it here and git push origin --delete on GitHub.
Ben's clone still sees origin/add-contact; git fetch --prune removes it.
Branch, PR, review, merge and cleanup: that is how a task reaches main.
git branch -d deletes it here and git push origin --delete on GitHub. Ben's clone still sees origin/add-contact; git fetch --prune removes it. Branch, PR, review, merge and cleanup: that is how a task reaches main.