|
| 1 | +# GitHub: Merge to Main and Sync |
| 2 | + |
| 3 | +Use this checklist so **main** is up to date and everything is synced with GitHub. |
| 4 | + |
| 5 | +## 1. Check current state |
| 6 | + |
| 7 | +From the repo root (`chrome-devtools-mcp`): |
| 8 | + |
| 9 | +```powershell |
| 10 | +# Auth (one-time or if needed) |
| 11 | +gh auth status |
| 12 | +
|
| 13 | +# Current branch and status |
| 14 | +git branch -a |
| 15 | +git status |
| 16 | +
|
| 17 | +# Open PRs targeting main (your fork) |
| 18 | +gh pr list --repo omalleyandy/chrome-devtools-mcp --state open --base main |
| 19 | +``` |
| 20 | + |
| 21 | +- If you have **uncommitted changes**: commit or stash first. |
| 22 | +- If you have **open PRs** you want to merge: use the steps in **Merge open PRs** below. |
| 23 | + |
| 24 | +## 2. Sync main with remote |
| 25 | + |
| 26 | +Get latest from **origin** (your fork) and keep local main in sync: |
| 27 | + |
| 28 | +```powershell |
| 29 | +git switch main |
| 30 | +git pull origin main |
| 31 | +git push origin main |
| 32 | +``` |
| 33 | + |
| 34 | +If you also track **upstream** (ChromeDevTools/chrome-devtools-mcp) and want to bring in their latest: |
| 35 | + |
| 36 | +```powershell |
| 37 | +git fetch upstream |
| 38 | +git switch main |
| 39 | +git merge upstream/main |
| 40 | +# Resolve conflicts if any, then: |
| 41 | +git push origin main |
| 42 | +``` |
| 43 | + |
| 44 | +## 3. Merge open PRs into main |
| 45 | + |
| 46 | +For each PR you want to land: |
| 47 | + |
| 48 | +```powershell |
| 49 | +# 1. Clean main |
| 50 | +git switch main |
| 51 | +git pull origin main |
| 52 | +
|
| 53 | +# 2. Merge the PR (from GitHub; replace 123 with PR number) |
| 54 | +gh pr merge 123 --squash |
| 55 | +# Or: gh pr merge 123 --rebase (to keep linear history) |
| 56 | +
|
| 57 | +# 3. Pull the updated main locally |
| 58 | +git pull origin main |
| 59 | +``` |
| 60 | + |
| 61 | +Or merge via a temporary integration branch (see [PR Landing Mode](https://cli.github.com/manual/) in the GitHub skill): |
| 62 | + |
| 63 | +```powershell |
| 64 | +git switch main |
| 65 | +git pull origin main |
| 66 | +git switch -c integrate-pr-123 |
| 67 | +gh pr checkout 123 |
| 68 | +git switch integrate-pr-123 |
| 69 | +git merge --squash <pr-branch-name> |
| 70 | +# ... fix/changelog, then: |
| 71 | +git switch main |
| 72 | +git merge integrate-pr-123 |
| 73 | +git push origin main |
| 74 | +git branch -d integrate-pr-123 |
| 75 | +``` |
| 76 | + |
| 77 | +## 4. Final sync check |
| 78 | + |
| 79 | +```powershell |
| 80 | +git switch main |
| 81 | +git pull origin main |
| 82 | +git status |
| 83 | +git log -1 --oneline |
| 84 | +``` |
| 85 | + |
| 86 | +- `git status` should be clean (or only show intended changes). |
| 87 | +- Your latest commit should match what you see on GitHub for `main`. |
| 88 | + |
| 89 | +## Quick one-liner (main only, no PR merge) |
| 90 | + |
| 91 | +If you only want to **update local main from origin** and **push any local main commits**: |
| 92 | + |
| 93 | +```powershell |
| 94 | +git switch main && git pull origin main --rebase && git push origin main |
| 95 | +``` |
| 96 | + |
| 97 | +## Remotes (this repo) |
| 98 | + |
| 99 | +- **origin**: `git@github.com:omalleyandy/chrome-devtools-mcp.git` (your fork) |
| 100 | +- **upstream**: `https://github.com/ChromeDevTools/chrome-devtools-mcp.git` (upstream) |
| 101 | + |
| 102 | +All merge/sync steps above use **origin**; add **upstream** only when you want to pull from ChromeDevTools. |
0 commit comments