docs: document git.fetch and git.push config options

Someone on Discord asked this exact question, but these options apparently
weren't documented when they were added in the `0.7.0` release.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
Austin Seipp 2024-02-07 18:32:41 -06:00
parent 6c1aeff7a9
commit 015c52bcdc
2 changed files with 28 additions and 1 deletions

View file

@ -514,6 +514,29 @@ conflict is considered fully resolved when there are no conflict markers left.
## Git settings
### Default remotes for `jj git fetch` and `jj git push`
By default, if a single remote exists it is used for `jj git fetch` and `jj git
push`; however if multiple remotes exist, the default remote is assumed to be
named `"origin"`, just like in Git. Sometimes this is undesirable, e.g. when you
want to fetch from a different remote than you push to, such as a GitHub fork.
To change this behavior, you can modify the [repository
configuration](#config-files-and-toml) variable `git.fetch`, which can be a
single remote, or a list of remotes to fetch from multiple places:
```
jj config set --repo git.fetch "upstream"
jj config set --repo git.fetch '["origin", "upstream"]'
```
Similarly, you can also set the variable `git.push` to cause `jj git push` to
push to a different remote:
```
jj config set --repo git.push "github"
```
### Automatic local branch creation
When `jj` imports a new remote-tracking branch from Git, it can also create a

View file

@ -27,3 +27,7 @@ template-aliases.'format_timestamp(timestamp)' = 'timestamp.ago()'
# see documentation in config.md. An example:
# merge-tools.meld.program = "C:\\Program Files\\Meld\\meld.exe" # If not in PATH
# Change the default push/fetch remote for `jj git push` and `jj git fetch`
# git.fetch = "upstream"
# git.push = "myfork"