[2026-10-16] eagle: work/apple-browsers-worktree-workflow.md
This commit is contained in:
1 parent
31edacc451
commit
00ffe7b51a
1 file changed
+2
-4
@@ -1,6 +1,6 @@
|
||||
# Apple Browsers: Git worktrees
|
||||
|
||||
Keep one shared Git database at `~/DuckDuckGo/apple-browsers.git/.git` and put independent checkouts beside it inside `apple-browsers.git/`. The container directory has no checked-out source of its own.
|
||||
A Git worktree is another checkout of the same repository. It lets you keep `main` and feature branches in separate folders, work on them independently, and share one Git history instead of cloning the repo again. In this setup, `apple-browsers.git/.git` stores that shared history; `main/` and feature folders are the worktrees.
|
||||
|
||||
## First-time setup
|
||||
|
||||
@@ -13,8 +13,6 @@ git fetch origin
|
||||
git worktree add main main
|
||||
```
|
||||
|
||||
This matches the local layout: `.git/` holds shared history; `main/` is a normal checkout. Access to private dependencies may be needed to build; see `README.md` inside a checkout.
|
||||
|
||||
## Work on a branch
|
||||
|
||||
From `~/DuckDuckGo/apple-browsers.git`:
|
||||
@@ -27,6 +25,6 @@ git submodule update --init --recursive
|
||||
open DuckDuckGo.xcworkspace
|
||||
```
|
||||
|
||||
Edit, build, commit, and push **inside `my-feature/`** as with any clone. Each worktree has its own working files and branch; they share the same Git history. For an existing local branch, use `git worktree add <folder> <branch>`; for a remote branch, use `git worktree add --track -b <branch> <folder> origin/<branch>` if you have not created it locally.
|
||||
The `git worktree add -b` command creates `my-feature/` on a new branch based on `origin/main`. Edit, build, commit, and push inside that folder. For an existing local branch, use `git worktree add <folder> <branch>`; for a remote branch, use `git worktree add --track -b <branch> <folder> origin/<branch>` if you have not created it locally.
|
||||
|
||||
Use `git worktree list` to find checkouts. After checking that a checkout has no work to keep, run `git worktree remove <folder>` from the container directory. The branch remains available.
|
||||
Reference in new issue
Block a user