You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dbabbba
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: content/organizations/managing-organization-settings/sync-external-custom-properties.md
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ Each display name is scoped to a single {% data variables.product.prodname_githu
35
35
36
36
Choose a name that will avoid conflicts and will help users identify custom properties from the external system. If you're publishing an app on behalf of a third-party system, you may want to respond to conflicts or allow users to choose their own display name as part of the setup flow on your system.
37
37
38
-
The display name must between 1 and 15 characters and contain only letters and numbers. For all requirements, see the [Register an app installation for external properties](/rest/orgs/custom-properties#register-an-app-installation-for-external-custom-properties) endpoint of the REST API.
38
+
The display name must be between 1 and 15 characters and contain only letters and numbers. For all requirements, see the [Register an app installation for external properties](/rest/orgs/custom-properties#register-an-app-installation-for-external-custom-properties) endpoint of the REST API.
39
39
40
40
## 2. Register a {% data variables.product.prodname_github_app %}
41
41
@@ -83,14 +83,21 @@ The automation can run on a schedule or listen for events. The webhook you selec
83
83
84
84
In the automation, the {% data variables.product.prodname_github_app %} must obtain an installation access token and use the token to send data from the external system to {% data variables.product.github %}'s external properties API endpoints. See [AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation).
85
85
86
-
See the following endpoints of the REST API. You will find information on request size limits and error codes that your automation should account for.
86
+
A typical flow would be to:
87
87
88
-
*[Register an app installation for external custom properties](/rest/orgs/custom-properties#register-an-app-installation-for-external-custom-properties) (the app must register its display name before it can update properties, unless an organization administrator is expected to do this)
89
-
*[Get registered app installations for external custom properties](/rest/orgs/custom-properties#get-registered-app-installations-for-external-custom-properties)
90
-
*[Get all external custom properties for a {% data variables.product.prodname_github_app %} installation in an organization](/rest/orgs/custom-properties#get-all-external-custom-properties-for-a-github-app-installation-in-an-organization)
91
-
*[Create or update external custom property values for organization repositories](/rest/orgs/custom-properties#create-or-update-external-custom-property-values-for-organization-repositories)
92
-
*[Create or update external custom property values for a property across organization repositories](/rest/orgs/custom-properties#create-or-update-external-custom-property-values-for-a-property-across-organization-repositories)
93
-
*[Remove all external custom property values for a property across all organization repositories](/rest/orgs/custom-properties#remove-all-external-custom-property-values-for-a-property-across-all-organization-repositories)
88
+
1.**Register the app installation** with a display name before updating properties, unless an organization administrator will register it. See [Register an app installation for external custom properties](/rest/orgs/custom-properties#register-an-app-installation-for-external-custom-properties).
89
+
1.**Create or update property values for one or more repositories**. See:
90
+
91
+
*[Create or update external custom property values for organization repositories](/rest/orgs/custom-properties#create-or-update-external-custom-property-values-for-organization-repositories)
92
+
*[Create or update external custom property values for a property across organization repositories](/rest/orgs/custom-properties#create-or-update-external-custom-property-values-for-a-property-across-organization-repositories)
93
+
94
+
You might also need to:
95
+
96
+
***Remove all values for one property across all organization repositories**. See [Remove all external custom property values for a property across all organization repositories](/rest/orgs/custom-properties#remove-all-external-custom-property-values-for-a-property-across-all-organization-repositories).
97
+
***Get the external custom properties for the app installation** to verify the property definitions. See [Get all external custom properties for a {% data variables.product.prodname_github_app %} installation in an organization](/rest/orgs/custom-properties#get-all-external-custom-properties-for-a-github-app-installation-in-an-organization).
98
+
***Get the registered app installations** to verify registration details. See [Get registered app installations for external custom properties](/rest/orgs/custom-properties#get-registered-app-installations-for-external-custom-properties).
99
+
100
+
Check the linked REST API references for request size limits and error codes that your automation needs to handle.
Copy file name to clipboardExpand all lines: content/pull-requests/reference/stacked-prs-cli-commands.md
+38-1Lines changed: 38 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ The `gh stack` extension for {% data variables.product.prodname_cli %} creates a
19
19
gh extension install github/gh-stack
20
20
```
21
21
22
-
The extension requires {% data variables.product.prodname_cli %} (`gh`) version 2.0 or later.
22
+
The extension requires {% data variables.product.prodname_cli %} (`gh`) version 2.0 or later, and Git 2.36 or later.
23
23
24
24
> [!NOTE]
25
25
> The `gh stack` extension uses your {% data variables.product.prodname_cli %} authentication. If you have not authenticated yet, run `gh auth login`.
@@ -63,6 +63,8 @@ Initializes a new stack locally. In interactive mode (no arguments), the command
63
63
64
64
When you provide explicit branch names, existing branches are adopted automatically and any missing branches are created. The trunk defaults to the repository's default branch unless you override it with `--base`.
65
65
66
+
Branches checked out in other worktrees can be adopted. If the final branch is already checked out elsewhere, `init` leaves your current checkout unchanged and reports the owning worktree instead.
67
+
66
68
The command enables `git rerere` automatically, so that conflict resolutions are remembered across rebases.
67
69
68
70
| Flag | Description |
@@ -95,6 +97,8 @@ gh stack add [flags] [branch]
95
97
96
98
For an existing stack, creates a new branch at the current HEAD, adds it to the top of the stack, and checks it out. You must run this command while on the topmost branch of a stack. If you do not provide a branch name, the command prompts for one.
97
99
100
+
If the branch name you provide is already checked out in another worktree, `add` adopts the existing branch without switching either checkout. The commit and stage shortcuts `-m`, `-A`, and `-u` are incompatible with that kind of adoption, and the command fails before staging anything or changing stack membership.
101
+
98
102
When you run the command interactively from a branch that is not part of a stack, `add` offers to initialize a new stack instead. The branch name you supply, or the auto-generated name, becomes the first layer. If you don't supply a name, the standard `init` prompts are used.
99
103
100
104
You can optionally stage changes and create a commit as part of the `add` flow. When you provide `-m` without an explicit branch name, the branch name is generated automatically in date and slug format, such as `03-24-add_login`.
@@ -166,6 +170,12 @@ Check out a stack by its stack number, a pull request number, a pull request URL
|`--print-path`| Print the target worktree's absolute path. Requires an explicit target and never prompts. |
176
+
177
+
For a target that is checked out in another worktree, `--print-path` prints that worktree's path without changing either checkout. For a target that is not checked out anywhere, the command checks out the branch in the current worktree before printing its path. Without the flag, trying to check out a target that's occupied elsewhere is an error that includes a path diagnostic, rather than a successful switch. See [Navigation](#navigation) for details on the output contract.
178
+
169
179
A bare number is interpreted first as a stack or pull request number. These are repository-scoped identifiers shown in the {% data variables.product.github %} UI. If nothing matches the number, it is tried as a branch name.
170
180
171
181
When you reference a remote stack, the command fetches the stack on {% data variables.product.github %}, pulls the branches, and sets up the stack locally. If the stack already exists locally and matches, the command switches to the branch. If the local and remote stacks have different compositions, you are prompted to resolve the conflict.
@@ -217,6 +227,9 @@ The command checks these conditions before opening the interface:
217
227
1. No rebase is in progress.
218
228
1. No pull request in the stack is queued for merge.
219
229
1. Commit history must be linear, with no merge commits and no diverged branches.
230
+
1. Every worktree needed by the staged actions, and by the branches that survive the cascade, must be clean and free of other Git operations.
231
+
232
+
Stack branches can be distributed across worktrees. Renames run in the branch's own worktree. Fold-down cherry-picks run in the receiving branch's worktree. Cascading rebases run each branch in its own worktree. A branch that isn't checked out anywhere uses the worktree you ran `modify` from, and inserted branches are created as refs without new worktrees. Dropped and folded branches, and their worktrees, are preserved. The trunk branch is only read, so unrelated or untouched source worktrees don't need to be clean.
220
233
221
234
**Operations**
222
235
@@ -241,6 +254,10 @@ If a rebase conflict occurs, you can either:
241
254
* Resolve the conflicts, stage the files, then run `gh stack modify --continue`.
242
255
* Run `gh stack modify --abort` to abort the operation and restore the stack to its previous state.
243
256
257
+
Resolve and stage conflicts in the worktree named in the conflict message, which may be a foreign fold receiver's worktree or a rebase owner's worktree rather than the one you ran `modify` from. Both `--continue` and `--abort` can be run from any linked worktree, because they use the recorded owner rather than your current checkout. Continuing resumes any remaining structural actions as well as remaining rebases. Aborting reverses renames in their own worktrees, restores only the refs that the operation touched, and deletes only the refs it created. If a restore or a journal or catalog save fails, the recovery state is retained so you can retry.
258
+
259
+
Other worktrees are never switched to a different branch. The worktree you ran `modify` from returns to its original branch, including its new name if that branch was renamed, or to the nearest surviving branch if the original is gone. If that surviving branch is checked out elsewhere, your worktree instead keeps its preserved original branch, and the command reports the surviving branch's path. Any pending state used by `gh stack submit` is only consumed for the stack that was just modified.
260
+
244
261
**After modifying**
245
262
246
263
If you have already created a stack of pull requests on {% data variables.product.github %}, run `gh stack submit` to push the updated branches and recreate the stack. The old stack is replaced automatically.
@@ -399,6 +416,8 @@ If a rebase conflict occurs, the operation pauses and prints the conflicted file
399
416
|`--remote <name>`| Remote to fetch from (defaults to the automatically detected remote) |
400
417
|`--committer-date-is-author-date`| Set the committer date to the author date during the rebase. Alias: `--preserve-dates`. |
401
418
419
+
Date-preserving rebases explicitly use Git's merge backend, so the setting persists across conflicts. `--continue` reuses the native rebase settings that were saved when the rebase started, and doesn't resend start-only date options.
420
+
402
421
| Argument | Description |
403
422
|----------|-------------|
404
423
|`[branch]`| Target branch (defaults to the current branch) |
@@ -543,6 +562,10 @@ Navigation commands move you between branches in the current stack without havin
543
562
544
563
All navigation commands clamp to the bounds of the stack. Moving up from the top, or down from the bottom, does nothing and displays a message.
545
564
565
+
`up`, `down`, `top`, `bottom`, `trunk`, and `checkout` with an explicit target all support `--print-path`. For a target checked out in another worktree, the command prints that worktree's path without switching to it. For a target that isn't checked out anywhere, the command checks it out in the worktree you ran it from, then prints that worktree's path. If the target is already checked out in the current worktree, the command prints the current worktree's root.
566
+
567
+
When you use `--print-path` successfully, standard output contains only the raw absolute path followed by a single newline. Diagnostics are written to standard error, and a failed or ambiguous target produces no standard output at all; `--print-path` never prompts. Without the flag, navigating to a branch that's checked out elsewhere fails and reports that branch's path. If you wrap `gh stack` in a shell function to `cd` into the printed path, check the command's exit status first, quote the path, and avoid `eval`.
568
+
546
569
### `gh stack switch`
547
570
548
571
Interactively switch to another branch in the stack.
@@ -686,6 +709,20 @@ gh stack feedback
686
709
gh stack feedback "Support for reordering branches"
687
710
```
688
711
712
+
## Worktree support
713
+
714
+
`gh stack` works across linked Git worktrees in the same clone.
715
+
716
+
All linked worktrees share one `gh-stack` state directory and recovery journal, stored under the repository's common directory. Native Git state, such as `HEAD`, the index, and in-progress rebase or cherry-pick markers, stays local to each worktree. Mutating commands are serialized across the whole clone, but read-only commands such as `gh stack view` remain available while a mutation runs in another worktree.
717
+
718
+
Nonconflicting legacy catalogs migrate to the current format automatically, and the original files are preserved. Catalogs with conflicting definitions require manual reconciliation. Complete any in-progress legacy recovery in its original worktree before migrating, and don't mix old and new catalog versions in the same clone.
719
+
720
+
`gh stack rebase` and `gh stack sync` automatically update the branches of any affected worktree that is clean, meaning it has no uncommitted changes, no other Git operation in progress, and is otherwise unchanged. They block updates to worktrees that are dirty, busy, missing, or have changed unexpectedly. Neither command stashes your changes automatically, or creates or removes worktrees for you.
721
+
722
+
For commands that share a recovery journal, `--continue` and `--abort` operate on the worktree recorded in the journal, not the worktree you run the command from. If recovery fails partway through, the operation's state is retained so you can retry.
723
+
724
+
For repositories created with `git init --separate-git-dir`, `gh stack` supports invocation from the main worktree, and from linked worktrees that have an absolute or relative `core.worktree` backlink to the main worktree, including settings stored in the main worktree's `config.worktree` file. The one unsupported configuration is invoking `gh stack` from a linked worktree that has no backlink to the main worktree. If an operation requires access to that worktree and can't find it, the operation fails with guidance on how to proceed; worktrees unaffected by the missing backlink continue to work normally. `gh stack` never uses a Git administration directory as a checkout destination.
0 commit comments