ok/jj
1
0
Fork 0
forked from mirrors/jj

docs branches.md: updates to jj branch (un)track docs

This commit is contained in:
Ilya Grigoriev 2024-01-03 19:09:22 -08:00
parent ef23c35550
commit 5eb55b035e

View file

@ -51,7 +51,7 @@ some remote.
If you want to know the internals of branch tracking, consult the If you want to know the internals of branch tracking, consult the
[Design Doc][design]. [Design Doc][design].
### Tracking a branch ### Manually tracking a branch
To track a branch permanently use `jj branch track <branch name>@<remote name>`. To track a branch permanently use `jj branch track <branch name>@<remote name>`.
It will now be imported as a local branch until you untrack it or it is deleted It will now be imported as a local branch until you untrack it or it is deleted
@ -66,16 +66,17 @@ $ # Find the branch.
$ # [...] $ # [...]
$ # Actually track the branch. $ # Actually track the branch.
$ jj branch track <branch name>@<remote name> # Example: jj branch track my-feature@origin $ jj branch track <branch name>@<remote name> # Example: jj branch track my-feature@origin
$ # From this point on, branch <name> is tracked and will always be imported. $ # From this point on, <branch name> will be imported when fetching from <remote name>.
$ jj git fetch # Update the repository $ jj git fetch --remote <remote name>
$ jj new <name> # Do some local testing, etc. $ # A local branch <branch name> should have been created or updated while fetching.
$ jj new <branch name> # Do some local testing, etc.
``` ```
### Untracking a branch ### Untracking a branch
To no longer have a branch available in a repository, you can To stop following a remote branch, you can `jj branch untrack` it. After that,
`jj branch untrack` it. After that subsequent fetches will no longer copy the subsequent fetches of that remote will no longer move the local branch to match
branch into the local repository. the position of the remote branch.
Example: Example:
@ -86,7 +87,9 @@ $ # Find the branch we no longer want to track.
$ # [...] $ # [...]
# # Actually untrack it. # # Actually untrack it.
$ jj branch untrack <branch name>@<remote name> # Example: jj branch untrack stuff@origin $ jj branch untrack <branch name>@<remote name> # Example: jj branch untrack stuff@origin
$ # From this point on, it won't be imported anymore. $ # From this point on, this remote branch won't be imported anymore.
$ # The local branch (e.g. stuff) is unaffected. It may or may not still
$ # be tracking branches on other remotes (e.g. stuff@upstream).
``` ```
### Automatic tracking of branches & `git.auto-local-branch` option ### Automatic tracking of branches & `git.auto-local-branch` option