NMBUG(1)
π¦ NAME π¦
nmbug β manage notmuch bugs with git
okay so this whole page is NMBUG(1), part of the notmuch manual, and it's literally your bestie for wrangling notmuch tags with Git π
β¨ SYNOPSIS β¨
notmuch git [-h] [-N] [-C repo] [-p prefix] [-v] [-l log level]
subcommand
nmbug [-h] [-C repo] [-p prefix] [-v] [-l log level] subcommand
two ways in, same energy π«Ά
πΈ DESCRIPTION πΈ
Manage notmuch tags with Git.
that's it, that's the whole vibe. tags in, git out, no cap β¨
π OPTIONS π
Supported options for notmuch git include:
-h,--helpβ show help message and exit-N,--nmbugβ Set defaults for--tag-prefixand--git-dirsuitable for the notmuch <> bug tracker-C <repo>,--git-dir <repo>β Operate on git repository repo. See REPOSITORY LOCATION for defaults.-p <prefix>,--tag-prefix <prefix>β Operate only on tags with prefix prefix. See PREFIX VALUE for defaults.-v,--versionβ show notmuch-git's version number and exit-l <level>,--log-level <level>β Log verbosity, one of:critical,error,warning,info,debug. Defaults towarning.
π SUBCOMMANDS π
For help on a particular subcommand, run: 'notmuch-git ... <command> --help'.
ngl bestie, that's the cheat code. use it liberally π₯
π¦ archive [tree-ish] [arg ...]
Dump a tar archive of a committed tag set using 'git archive'. See REPOSITORY CONTENTS for details of the archive contents.
- tree-ish β The tree or commit to produce an archive for. Defaults to
'HEAD'. - arg β If present, any optional arguments are passed through to
git-archive(1)(https://manpages.debian.org/git-archive.1.html). Arguments to git-archive are reordered so that tree-ish comes last.
π§ checkout [-f|--force]
Update the notmuch database from git.
This is mainly useful to discard your changes in notmuch relative to git.
[-f|--force]β Override checks that prevent modifying tags for large fractions of messages in the database. See alsogit.safe_fraction(#nmconfig-git.safe_fraction).
π clone <repository>
Create a local notmuch git repository from a remote source.
This wraps 'git clone', adding some options to avoid creating a working tree while preserving remote-tracking branches and upstreams.
- repository β The (possibly remote) repository to clone from. See the URLS section of
git-clone(1)(https://manpages.debian.org/git-clone.1.html) for more information on specifying repositories.
π commit [-f|--force] [message]
Commit prefix-matching tags from the notmuch database to git.
- message β Optional text for the commit message.
-f|--forceβ Override checks that prevent modifying tags for large fractions of messages in the database. See alsogit.safe_fraction(#nmconfig-git.safe_fraction).
π¦ fetch [remote]
Fetch changes from the remote repository.
- remote β Override the default configured in
branch.<name>.remoteto fetch from a particular remote repository (e.g.origin).
π help
Show brief help for an notmuch git command.
β init [--format-version=N]
Create an empty notmuch git repository.
This wraps 'git init' with a few extra steps to support subsequent status and commit commands.
--format-version=Nβ Create a repo in format version N. By default notmuch-git <> uses the highest supported version, which is the best choice for most use-cases.
π log [arg ...]
A wrapper for 'git log'.
- arg β Additional arguments are passed through to
'git log'.
After running notmuch git fetch, you can inspect the changes with
$ notmuch git log HEAD..@{upstream}
π merge [reference]
Merge changes from 'reference' into HEAD and load the result into notmuch.
- reference β Reference, usually other branch heads, to merge into our branch. Defaults to
@{upstream}.
β¬οΈ pull [repository] [refspec ...]
Pull (merge) remote repository changes to notmuch.
pull is equivalent to fetch followed by merge. We use the git-configured repository for your current branch (branch.<name>.repository, likely origin, and branch.<name>.merge, likely master or main).
- repository β The "remote" repository that is the source of the pull. This parameter can be either a URL (see the section GIT URLS in
git-pull(1)(https://manpages.debian.org/git-pull.1.html)) or the name of a remote (see the section REMOTES ingit-pull(1)(https://manpages.debian.org/git-pull.1.html)). - refspec β Refspec (usually a branch name) to fetch and merge. See the
refspecentry in the OPTIONS section ofgit-pull(1)(https://manpages.debian.org/git-pull.1.html) for other possibilities.
β¬οΈ push [repository] [refspec]
Push the local notmuch git git state to a remote repository.
yes it says "git git", we're keeping it, it's iconic π
- repository β The "remote" repository that is the destination of the push. This parameter can be either a URL (see the section GIT URLS in
git-push(1)(https://manpages.debian.org/git-push.1.html)) or the name of a remote (see the section REMOTES ingit-push(1)(https://manpages.debian.org/git-push.1.html)). - refspec β Refspec (usually a branch name) to push. See the
refspecentry in the OPTIONS section ofgit-push(1)(https://manpages.debian.org/git-push.1.html) for other possibilities.
π status
Show pending updates in notmuch or git repo.
Prints lines of the form
ng Message-Id tag
where n is a single character representing notmuch database status:
Aβ Tag is present in notmuch database, but not committed to git (equivalently, tag has been deleted in git repo, e.g. by a pull, but not restored to notmuch database).Dβ Tag is present in git repo, but not restored to notmuch database (equivalently, tag has been deleted in notmuch).Uβ Message is unknown (missing from local notmuch database).
The second character g (if present) represents a difference between local and upstream branches. Typically notmuch git fetch needs to be run to update this.
aβ Tag is present in upstream, but not in the local git branch.dβ Tag is present in local git branch, but not upstream.
ποΈ REPOSITORY CONTENTS ποΈ
The tags are stored in the git repo (and exported) as a set of empty files. These empty files are contained within a directory named after the message-id.
In what follows encode() represents a POSIX filesystem safe encoding. The encoding preserves alphanumerics, and the characters +-_@=.,:. All other octets are replaced with % followed by a two digit hex number.
Currently notmuch-git <> can read any format version, but can only create (via init) version 1 repositories.
π§Έ Version 0
This is the legacy format created by the nmbug tool prior to release 0.37. For a message with Message-Id id, for each tag tag, there is an empty file with path
tags/encode(id)/encode(tag)
π§ Version 1
In format version 1 and later, the format version is contained in a top level file called FORMAT.
For a message with Message-Id id, for each tag tag, there is an empty file with path
tags/hash1(id)/hash2(id)encode(id)/encode(tag)
The hash functions each represent one byte of the blake2b hex digest.
Compared to version 0, this reduces the number of subdirectories within each directory.
π REPOSITORY LOCATION π
notmuch-git <> uses the first of the following with a non-empty value to locate the git repository.
- Option
--git-dir. - Environment variable
NOTMUCH_GIT_DIR. - Configuration item
git.path(#nmconfig-git.path) - If invoked as
nmbugor with the--nmbugoption,$HOME/.nmbug; otherwise$XDG_DATA_HOME/notmuch/$NOTMUCH_PROFILE/git.
π·οΈ PREFIX VALUE π·οΈ
notmuch-git <> uses the first of the following with a non-null value to define the tag prefix.
- Option
--tag-prefix. - Environment variable
NOTMUCH_GIT_PREFIX. - Configuration item
git.tag_prefix(#nmconfig-git.tag_prefix). - If invoked as
nmbugor with the--nmbugoption,notmuch::, otherwise the empty string.
πΏ ENVIRONMENT πΏ
Variable NOTMUCH_PROFILE (#envvar-NOTMUCH_PROFILE) influences REPOSITORY LOCATION. If it is unset, 'default' is assumed.
NOTMUCH_GIT_DIRβ Default location of git repository. Overridden by--git-dir.NOTMUCH_GIT_PREFIXβ Default tag prefix (filter). Overridden by--tag-prefix.
π SEE ALSO π
notmuch (#notmuch-1), notmuch-dump (#notmuch-dump-1), notmuch-restore (#notmuch-restore-1), notmuch-tag (#notmuch-tag-1)
π Author π
Carl Worth and many others
π Copyright π
2009-2026, Carl Worth and many others
and that's the whole page, bestie!! π«Άβ¨ this was notmuch version 0.40, dated Jan 31, 2026 β go forth and tag responsibly, you absolute icon π ππ
π¦ where this page comes from
- fedora 44: notmuch-git 0.40-1.fc44 Β· GPL-3.0-or-later
- nixos 26.05: notmuch 0.40
- ubuntu resolute: notmuch-git 0.40-1ubuntu1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms