jj/latest/bookmarks/index.html

1870 lines
49 KiB
HTML

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="https://martinvonz.github.io/jj/latest/bookmarks/">
<link rel="prev" href="../working-copy/">
<link rel="next" href="../conflicts/">
<link rel="icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.39">
<title>Bookmarks - Jujutsu docs</title>
<link rel="stylesheet" href="../assets/stylesheets/main.8c3ca2c6.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.06af60db.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#bookmarks" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<div data-md-color-scheme="default" data-md-component="outdated" hidden>
</div>
<header class="md-header md-header--shadow" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href=".." title="Jujutsu docs" class="md-header__button md-logo" aria-label="Jujutsu docs" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
Jujutsu docs
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Bookmarks
</span>
</div>
</div>
</div>
<form class="md-header__option" data-md-component="palette">
<input class="md-option" data-md-color-media="(prefers-color-scheme)" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to system preference" type="radio" name="__palette" id="__palette_0">
<label class="md-header__button md-icon" title="Switch to system preference" for="__palette_1" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m14.3 16-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9zM20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zm-9.15 3.96h2.3L12 9z"/></svg>
</label>
<input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_1">
<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_2" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg>
</label>
<input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_2">
<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_0" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6a6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg>
</label>
</form>
<script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
</button>
</nav>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href=".." title="Jujutsu docs" class="md-nav__button md-logo" aria-label="Jujutsu docs" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
</a>
Jujutsu docs
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href=".." class="md-nav__link">
<span class="md-ellipsis">
Home
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" >
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">
<span class="md-ellipsis">
Getting started
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Getting started
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../install-and-setup/" class="md-nav__link">
<span class="md-ellipsis">
Installation and Setup
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../tutorial/" class="md-nav__link">
<span class="md-ellipsis">
Tutorial and Birds-Eye View
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../github/" class="md-nav__link">
<span class="md-ellipsis">
Working with GitHub
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../windows/" class="md-nav__link">
<span class="md-ellipsis">
Working on Windows
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../FAQ/" class="md-nav__link">
<span class="md-ellipsis">
FAQ
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../cli-reference/" class="md-nav__link">
<span class="md-ellipsis">
CLI Reference
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../testimonials/" class="md-nav__link">
<span class="md-ellipsis">
Testimonials
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../community_tools/" class="md-nav__link">
<span class="md-ellipsis">
Community-built tools
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7" checked>
<label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="0">
<span class="md-ellipsis">
Concepts
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_7">
<span class="md-nav__icon md-icon"></span>
Concepts
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../working-copy/" class="md-nav__link">
<span class="md-ellipsis">
Working Copy
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
<span class="md-ellipsis">
Bookmarks
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
Bookmarks
</span>
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#introduction" class="md-nav__link">
<span class="md-ellipsis">
Introduction
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#mapping-to-git-branches" class="md-nav__link">
<span class="md-ellipsis">
Mapping to Git branches
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#remotes-and-tracked-bookmarks" class="md-nav__link">
<span class="md-ellipsis">
Remotes and tracked bookmarks
</span>
</a>
<nav class="md-nav" aria-label="Remotes and tracked bookmarks">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#terminology-summary" class="md-nav__link">
<span class="md-ellipsis">
Terminology summary
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#manually-tracking-a-bookmark" class="md-nav__link">
<span class="md-ellipsis">
Manually tracking a bookmark
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#untracking-a-bookmark" class="md-nav__link">
<span class="md-ellipsis">
Untracking a bookmark
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#listing-tracked-bookmarks" class="md-nav__link">
<span class="md-ellipsis">
Listing tracked bookmarks
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#automatic-tracking-of-bookmarks-gitauto-local-bookmark-option" class="md-nav__link">
<span class="md-ellipsis">
Automatic tracking of bookmarks &amp; git.auto-local-bookmark option
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#bookmark-movement" class="md-nav__link">
<span class="md-ellipsis">
Bookmark movement
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pushing-bookmarks-safety-checks" class="md-nav__link">
<span class="md-ellipsis">
Pushing bookmarks: Safety checks
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#conflicts" class="md-nav__link">
<span class="md-ellipsis">
Conflicts
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#ease-of-use" class="md-nav__link">
<span class="md-ellipsis">
Ease of use
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../conflicts/" class="md-nav__link">
<span class="md-ellipsis">
Conflicts
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../operation-log/" class="md-nav__link">
<span class="md-ellipsis">
Operation Log
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../glossary/" class="md-nav__link">
<span class="md-ellipsis">
Glossary
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_8" >
<label class="md-nav__link" for="__nav_8" id="__nav_8_label" tabindex="0">
<span class="md-ellipsis">
Configuration
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_8">
<span class="md-nav__icon md-icon"></span>
Configuration
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../config/" class="md-nav__link">
<span class="md-ellipsis">
Settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../filesets/" class="md-nav__link">
<span class="md-ellipsis">
Fileset language
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../revsets/" class="md-nav__link">
<span class="md-ellipsis">
Revset language
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../templates/" class="md-nav__link">
<span class="md-ellipsis">
Templating language
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_9" >
<label class="md-nav__link" for="__nav_9" id="__nav_9_label" tabindex="0">
<span class="md-ellipsis">
Comparisons
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_9_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_9">
<span class="md-nav__icon md-icon"></span>
Comparisons
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../git-comparison/" class="md-nav__link">
<span class="md-ellipsis">
Git comparison
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../git-compatibility/" class="md-nav__link">
<span class="md-ellipsis">
Git compatibility
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../sapling-comparison/" class="md-nav__link">
<span class="md-ellipsis">
Sapling
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../related-work/" class="md-nav__link">
<span class="md-ellipsis">
Other related work
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_10" >
<label class="md-nav__link" for="__nav_10" id="__nav_10_label" tabindex="0">
<span class="md-ellipsis">
Technical details
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_10_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_10">
<span class="md-nav__icon md-icon"></span>
Technical details
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../technical/architecture/" class="md-nav__link">
<span class="md-ellipsis">
Architecture
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../technical/concurrency/" class="md-nav__link">
<span class="md-ellipsis">
Concurrency
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../technical/conflicts/" class="md-nav__link">
<span class="md-ellipsis">
Conflicts
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_11" >
<label class="md-nav__link" for="__nav_11" id="__nav_11_label" tabindex="0">
<span class="md-ellipsis">
Contributing
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_11_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_11">
<span class="md-nav__icon md-icon"></span>
Contributing
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../contributing/" class="md-nav__link">
<span class="md-ellipsis">
Guidelines and "How to...?"
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../code-of-conduct/" class="md-nav__link">
<span class="md-ellipsis">
Code of conduct
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../design_docs/" class="md-nav__link">
<span class="md-ellipsis">
Design Docs
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../design_doc_blueprint/" class="md-nav__link">
<span class="md-ellipsis">
Design Doc Blueprint
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../governance/temporary-voting/" class="md-nav__link">
<span class="md-ellipsis">
Temporary Voting for Governance
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_12" >
<label class="md-nav__link" for="__nav_12" id="__nav_12_label" tabindex="0">
<span class="md-ellipsis">
Design docs
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_12_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_12">
<span class="md-nav__icon md-icon"></span>
Design docs
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../roadmap/" class="md-nav__link">
<span class="md-ellipsis">
Roadmap
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../design/git-submodules/" class="md-nav__link">
<span class="md-ellipsis">
git-submodules
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../design/git-submodule-storage/" class="md-nav__link">
<span class="md-ellipsis">
git-submodule-storage
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../design/run/" class="md-nav__link">
<span class="md-ellipsis">
JJ run
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../design/sparse-v2/" class="md-nav__link">
<span class="md-ellipsis">
Sparse Patterns v2
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../design/tracking-branches/" class="md-nav__link">
<span class="md-ellipsis">
Tracking branches
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../design/copy-tracking/" class="md-nav__link">
<span class="md-ellipsis">
Copy tracking and tracing
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#introduction" class="md-nav__link">
<span class="md-ellipsis">
Introduction
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#mapping-to-git-branches" class="md-nav__link">
<span class="md-ellipsis">
Mapping to Git branches
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#remotes-and-tracked-bookmarks" class="md-nav__link">
<span class="md-ellipsis">
Remotes and tracked bookmarks
</span>
</a>
<nav class="md-nav" aria-label="Remotes and tracked bookmarks">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#terminology-summary" class="md-nav__link">
<span class="md-ellipsis">
Terminology summary
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#manually-tracking-a-bookmark" class="md-nav__link">
<span class="md-ellipsis">
Manually tracking a bookmark
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#untracking-a-bookmark" class="md-nav__link">
<span class="md-ellipsis">
Untracking a bookmark
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#listing-tracked-bookmarks" class="md-nav__link">
<span class="md-ellipsis">
Listing tracked bookmarks
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#automatic-tracking-of-bookmarks-gitauto-local-bookmark-option" class="md-nav__link">
<span class="md-ellipsis">
Automatic tracking of bookmarks &amp; git.auto-local-bookmark option
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#bookmark-movement" class="md-nav__link">
<span class="md-ellipsis">
Bookmark movement
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pushing-bookmarks-safety-checks" class="md-nav__link">
<span class="md-ellipsis">
Pushing bookmarks: Safety checks
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#conflicts" class="md-nav__link">
<span class="md-ellipsis">
Conflicts
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#ease-of-use" class="md-nav__link">
<span class="md-ellipsis">
Ease of use
</span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1 id="bookmarks">Bookmarks<a class="headerlink" href="#bookmarks" title="Permanent link">&para;</a></h1>
<h2 id="introduction">Introduction<a class="headerlink" href="#introduction" title="Permanent link">&para;</a></h2>
<p>Bookmarks are named pointers to revisions (just like branches are in Git). You
can move them without affecting the target revision's identity. Bookmarks
automatically move when revisions are rewritten (e.g. by <code>jj rebase</code>). You can
pass a bookmark's name to commands that want a revision as argument. For example,
<code>jj new main</code> will create a new revision on top of the <code>main</code> bookmark. Use
<code>jj bookmark list</code> to list bookmarks and <code>jj bookmark &lt;subcommand&gt;</code> to create,
move, or delete bookmarks. There is currently no concept of an
active/current/checked-out bookmark.</p>
<h2 id="mapping-to-git-branches">Mapping to Git branches<a class="headerlink" href="#mapping-to-git-branches" title="Permanent link">&para;</a></h2>
<p>Jujutsu maps its bookmarks to Git branches when interacting with Git repos. For
example, <code>jj git push --bookmark foo</code> will push the state of the <code>foo</code> bookmark
to the <code>foo</code> branch on the Git remote. Similarly, if you create a <code>bar</code> branch
in the backing Git repo, then a subsequent <code>jj git import</code> will create a <code>bar</code>
bookmark (reminder: that import happens automatically in
<a href="../git-compatibility/#co-located-jujutsugit-repos">colocated repos</a>).</p>
<h2 id="remotes-and-tracked-bookmarks">Remotes and tracked bookmarks<a class="headerlink" href="#remotes-and-tracked-bookmarks" title="Permanent link">&para;</a></h2>
<p>Jujutsu records the last seen position of a bookmark on each remote (just like
Git's remote-tracking branches). This record is updated on every <code>jj git fetch</code>
and <code>jj git push</code> of the bookmark. You can refer to the remembered remote bookmark
positions with <code>&lt;bookmark name&gt;@&lt;remote name&gt;</code>, such as <code>jj new main@origin</code>. <code>jj</code>
does not provide a way to manually edit these recorded positions.</p>
<p>A remote bookmark can be associated with a local bookmark of the same name. This
is called a <strong>tracked remote bookmark</strong> (which maps to a Git remote branch when
using the Git backend). When you pull a tracked bookmark from a remote, any
changes compared to the current record of the remote's state will be propagated
to the corresponding local bookmark, which will be created if it doesn't exist
already.</p>
<div class="admonition note">
<p class="admonition-title">Details: how <code>fetch</code> pulls bookmarks</p>
<p>Let's say you run <code>jj git fetch --remote origin</code> and, during the fetch, <code>jj</code>
determines that the remote's <code>main</code> bookmark has been moved so that its target is
now ahead of the local record in <code>main@origin</code>.</p>
<p><code>jj</code> will then update <code>main@origin</code> to the new target. If <code>main@origin</code> is
<strong>tracked</strong>, <code>jj</code> will also apply the change to the local bookmark <code>main</code>. If the
local target has also been moved compared to <code>main@origin</code> (probably because you
ran <code>jj bookmark set main</code>), then the two updates will be merged. If one is ahead
of the other, then that target will become the new target. Otherwise, the local
bookmark will become conflicted (see the <a href="#conflicts">"Conflicts" section</a> below
for details).</p>
</div>
<p>Most commands don't show the tracked remote bookmark if it has the same target as
the local bookmark. The local bookmark (without <code>@&lt;remote name&gt;</code>) is considered the
bookmark's desired target. Consequently, if you want to update a bookmark on a
remote, you first update the bookmark locally and then push the update to the
remote. If a local bookmark also exists on some remote but points to a different
target there, <code>jj log</code> will show the bookmark name with an asterisk suffix (e.g.
<code>main*</code>). That is meant to remind you that you may want to push the bookmark to
some remote.</p>
<p>If you want to know the internals of bookmark tracking, consult the
<a href="../design/tracking-branches/">Design Doc</a>.</p>
<h3 id="terminology-summary">Terminology summary<a class="headerlink" href="#terminology-summary" title="Permanent link">&para;</a></h3>
<ul>
<li>A <strong>remote bookmark</strong> is a bookmark ref on the remote. <code>jj</code> can find out its
actual state only when it's actively communicating with the remote. However,
<code>jj</code> does store the last-seen position of the remote bookmark; this is the
commit <code>jj show &lt;bookmark name&gt;@&lt;remote name&gt;</code> would show. This notion is
completely analogous to Git's "remote-tracking bookmarks".</li>
<li>A <strong>tracked (remote) bookmark</strong> is defined above. You can make a remote bookmark
tracked with the <a href="#manually-tracking-a-bookmark"><code>jj bookmark track</code> command</a>, for
example.</li>
<li>A <strong>tracking (local) bookmark</strong> is the local bookmark that <code>jj</code> tries to keep in
sync with the tracked remote bookmark. For example, after <code>jj bookmark track
mybookmark@origin</code>, there will be a local bookmark <code>mybookmark</code> that's tracking the
remote <code>mybookmark@origin</code> bookmark. A local bookmark can track a bookmark of the same
name on 0 or more remotes.</li>
</ul>
<p>The notion of tracked bookmarks serves a similar function to the Git notion of an
"upstream branch". Unlike Git, a single local bookmark can be tracking remote
bookmarks on multiple remotes, and the names of the local and remote bookmarks
must match.</p>
<h3 id="manually-tracking-a-bookmark">Manually tracking a bookmark<a class="headerlink" href="#manually-tracking-a-bookmark" title="Permanent link">&para;</a></h3>
<p>To track a bookmark permanently use <code>jj bookmark track &lt;bookmark name&gt;@&lt;remote name&gt;</code>.
It will now be imported as a local bookmark until you untrack it or it is deleted
on the remote. </p>
<p>Example:</p>
<div class="highlight"><pre><span></span><code>$<span class="w"> </span><span class="c1"># List all available bookmarks, as we want our colleague&#39;s bookmark.</span>
$<span class="w"> </span>jj<span class="w"> </span>bookmark<span class="w"> </span>list<span class="w"> </span>--all
$<span class="w"> </span><span class="c1"># Find the bookmark.</span>
$<span class="w"> </span><span class="c1"># [...]</span>
$<span class="w"> </span><span class="c1"># Actually track the bookmark.</span>
$<span class="w"> </span>jj<span class="w"> </span>bookmark<span class="w"> </span>track<span class="w"> </span>&lt;bookmark<span class="w"> </span>name&gt;@&lt;remote<span class="w"> </span>name&gt;<span class="w"> </span><span class="c1"># Example: jj bookmark track my-feature@origin</span>
$<span class="w"> </span><span class="c1"># From this point on, &lt;bookmark name&gt; will be imported when fetching from &lt;remote name&gt;.</span>
$<span class="w"> </span>jj<span class="w"> </span>git<span class="w"> </span>fetch<span class="w"> </span>--remote<span class="w"> </span>&lt;remote<span class="w"> </span>name&gt;
$<span class="w"> </span><span class="c1"># A local bookmark &lt;bookmark name&gt; should have been created or updated while fetching.</span>
$<span class="w"> </span>jj<span class="w"> </span>new<span class="w"> </span>&lt;bookmark<span class="w"> </span>name&gt;<span class="w"> </span><span class="c1"># Do some local testing, etc.</span>
</code></pre></div>
<h3 id="untracking-a-bookmark">Untracking a bookmark<a class="headerlink" href="#untracking-a-bookmark" title="Permanent link">&para;</a></h3>
<p>To stop following a remote bookmark, you can <code>jj bookmark untrack</code> it. After that,
subsequent fetches of that remote will no longer move the local bookmark to match
the position of the remote bookmark.</p>
<p>Example: </p>
<div class="highlight"><pre><span></span><code>$<span class="w"> </span><span class="c1"># List all local and remote bookmarks.</span>
$<span class="w"> </span>jj<span class="w"> </span>bookmark<span class="w"> </span>list<span class="w"> </span>--all
$<span class="w"> </span><span class="c1"># Find the bookmark we no longer want to track.</span>
$<span class="w"> </span><span class="c1"># [...]</span>
<span class="c1"># # Actually untrack it.</span>
$<span class="w"> </span>jj<span class="w"> </span>bookmark<span class="w"> </span>untrack<span class="w"> </span>&lt;bookmark<span class="w"> </span>name&gt;@&lt;remote<span class="w"> </span>name&gt;<span class="w"> </span><span class="c1"># Example: jj bookmark untrack stuff@origin</span>
$<span class="w"> </span><span class="c1"># From this point on, this remote bookmark won&#39;t be imported anymore.</span>
$<span class="w"> </span><span class="c1"># The local bookmark (e.g. stuff) is unaffected. It may or may not still</span>
$<span class="w"> </span><span class="c1"># be tracking bookmarks on other remotes (e.g. stuff@upstream).</span>
</code></pre></div>
<h3 id="listing-tracked-bookmarks">Listing tracked bookmarks<a class="headerlink" href="#listing-tracked-bookmarks" title="Permanent link">&para;</a></h3>
<p>To list tracked bookmarks, you can <code>jj bookmark list --tracked</code> or <code>jj bookmark list -t</code>.
This command omits local Git-tracking bookmarks by default.</p>
<p>You can see if a specific bookmark is tracked with <code>jj bookmark list --tracked &lt;bookmark name&gt;</code>.</p>
<h3 id="automatic-tracking-of-bookmarks-gitauto-local-bookmark-option">Automatic tracking of bookmarks &amp; <code>git.auto-local-bookmark</code> option<a class="headerlink" href="#automatic-tracking-of-bookmarks-gitauto-local-bookmark-option" title="Permanent link">&para;</a></h3>
<p>There are two situations where <code>jj</code> tracks bookmarks automatically. <code>jj git
clone</code> automatically sets up the default remote bookmark (e.g. <code>main@origin</code>) as
tracked. When you push a local bookmark, the newly created bookmark on the remote is
marked as tracked.</p>
<p>By default, every other remote bookmark is marked as "not tracked" when it's
fetched. If desired, you need to manually <code>jj bookmark track</code> them. This works
well for repositories where multiple people work on a large number of bookmarks. </p>
<p>The default can be changed by setting the config <code>git.auto-local-bookmark = true</code>.
Then, <code>jj git fetch</code> tracks every <em>newly fetched</em> bookmark with a local bookmark.
Branches that already existed before the <code>jj git fetch</code> are not affected. This
is similar to Mercurial, which fetches all its bookmarks (equivalent to Git
bookmarks) by default.</p>
<h2 id="bookmark-movement">Bookmark movement<a class="headerlink" href="#bookmark-movement" title="Permanent link">&para;</a></h2>
<p>Currently Jujutsu automatically moves local bookmarks when these conditions are
met:</p>
<ul>
<li>When a commit has been rewritten (e.g, when you rebase) bookmarks and the<br />
working-copy will move along with it.</li>
<li>When a commit has been abandoned, all associated bookmarks will be moved
to its parent(s). If a working copy was pointing to the abandoned commit,
then a new working-copy commit will be created on top of the parent(s).</li>
</ul>
<p>You could describe the movement as following along the change-id of the
current bookmark commit, even if it isn't entirely accurate.</p>
<h2 id="pushing-bookmarks-safety-checks">Pushing bookmarks: Safety checks<a class="headerlink" href="#pushing-bookmarks-safety-checks" title="Permanent link">&para;</a></h2>
<p>Before <code>jj git push</code> actually moves, creates, or deletes a remote bookmark, it
makes several safety checks.</p>
<ol>
<li>
<p><code>jj</code> will contact the remote and check that the actual state of the remote
bookmark matches <code>jj</code>'s record of its last known position. If there is a
conflict, <code>jj</code> will refuse to push the bookmark. In this case, you need to run
<code>jj git fetch --remote &lt;remote name&gt;</code> and resolve the resulting bookmark
conflict. Then, you can try <code>jj git push</code> again.</p>
<p>If you are familiar with Git, this makes <code>jj git push</code> similar to <code>git
push --force-with-lease</code>.</p>
<p>There are a few cases where <code>jj git push</code> will succeed even though the remote
bookmark is in an unexpected location. These are the cases where <code>jj git fetch</code>
would not create a bookmark conflict and would not move the local bookmark, e.g.
if the unexpected location is identical to the local position of the bookmark.</p>
</li>
<li>
<p>The local bookmark must not be <a href="#conflicts">conflicted</a>. If it is, you would
need to use <code>jj bookmark set</code>, for example, to resolve the conflict.</p>
<p>This makes <code>jj git push</code> safe even if <code>jj git fetch</code> is performed on a timer
in the background (this situation is a known issue<sup id="fnref:known-issue"><a class="footnote-ref" href="#fn:known-issue">1</a></sup> with some
forms of <code>git push --force-with-lease</code>). If the bookmark moves on a remote in a
problematic way, <code>jj git fetch</code> will create a conflict. This should ensure
that the user becomes aware of the conflict before they can <code>jj git push</code> and
override the bookmark on the remote.</p>
</li>
<li>
<p>If the remote bookmark already exists on the remote, it must be
<a href="#remotes-and-tracked-bookmarks">tracked</a>. If the bookmark does not already
exist on the remote, there is no problem; <code>jj git push</code> will create the
remote bookmark and mark it as tracked.</p>
</li>
</ol>
<h2 id="conflicts">Conflicts<a class="headerlink" href="#conflicts" title="Permanent link">&para;</a></h2>
<p>Bookmarks can end up in a conflicted state. When that happens, <code>jj status</code> will
include information about the conflicted bookmarks (and instructions for how to
mitigate it). <code>jj bookmark list</code> will have details. <code>jj log</code> will show the bookmark
name with a double question mark suffix (e.g. <code>main??</code>) on each of the
conflicted bookmark's potential target revisions. Using the bookmark name to look up
a revision will resolve to all potential targets. That means that <code>jj new main</code>
will error out, complaining that the revset resolved to multiple revisions.</p>
<p>Both local bookmarks (e.g. <code>main</code>) and the remote bookmark (e.g. <code>main@origin</code>) can
have conflicts. Both can end up in that state if concurrent operations were run
in the repo. The local bookmark more typically becomes conflicted because it was
updated both locally and on a remote.</p>
<p>To resolve a conflicted state in a local bookmark (e.g. <code>main</code>), you can move the
bookmark to the desired target with <code>jj bookmark move</code>. You may want to first either
merge the conflicted targets with <code>jj new</code> (e.g. <code>jj new 'all:main'</code>), or you may
want to rebase one side on top of the other with <code>jj rebase</code>.</p>
<p>To resolve a conflicted state in a remote bookmark (e.g. <code>main@origin</code>), simply
pull from the remote (e.g. <code>jj git fetch</code>). The conflict resolution will also
propagate to the local bookmark (which was presumably also conflicted).</p>
<h2 id="ease-of-use">Ease of use<a class="headerlink" href="#ease-of-use" title="Permanent link">&para;</a></h2>
<p>The use of bookmarks is frequent in some workflows, for example, when
interacting with Git repositories containing branches. To this end,
one-letter shortcuts have been implemented, both for the <code>jj bookmark</code>
command itself through an alias (as <code>jj b</code>), and for its subcommands.
For example, <code>jj bookmark create BOOKMARK-NAME</code> can be abbreviated as
<code>jj b c BOOKMARK-NAME</code>.</p>
<div class="footnote">
<hr />
<ol>
<li id="fn:known-issue">
<p>See "A general note on safety" in
<a href="https://git-scm.com/docs/git-push#Documentation/git-push.txt---no-force-with-lease">https://git-scm.com/docs/git-push#Documentation/git-push.txt---no-force-with-lease</a>&#160;<a class="footnote-backref" href="#fnref:known-issue" title="Jump back to footnote 1 in the text">&#8617;</a></p>
</li>
</ol>
</div>
</article>
</div>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.6ce7567c.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"alias": true, "provider": "mike"}}</script>
<script src="../assets/javascripts/bundle.525ec568.min.js"></script>
</body>
</html>