bup-get(1)
π NAME π
ok so bup-get β it copies repository items π«Ά and, bestie, there is a whole CAUTION situation below, do not skip it. (This one's from the General Commands Manual, page bup-get(1).)
πΈ SYNOPSIS πΈ
bup get [-s source-path] [-r host:path] OPTIONS <(METHOD ref [dest])>...
β¨ DESCRIPTION β¨
So like, bup get transfers the refs you point at from the source repository over to the destination repository β and yes it respects --bup-dir and BUP_DIR while doing it, obviously β and it does that according to whichever METHOD you picked. Your METHOD choices are, and I'm listing all of them, no skimping: --ff, --ff:, --append, --append:, --pick, --pick:, --force-pick, --force-pick:, --new-tag, --new-tag:, --replace, --replace:, or --unnamed. π
By default it will --copy the data without alteration (just a straight transfer, no notes), but it can also --rewrite it β which can potentially change the deduplication granularity, so like, the vibes of your dedup may shift β and it can --repair some kinds of damage. See the EXAMPLES below for a quick introduction, they're genuinely helpful fr fr.
The ref is the source repository reference of the object to be fetched, and the dest is the optional destination reference. Important: a dest may only be specified for a METHOD whose name ends in a colon. Like so:
bup get -s /source/repo --ff foo
bup get -s /source/repo --ff: foo/latest bar
bup get -s /source/repo --pick: foo/2010-10-10-101010 bar
bup get -s /source/repo --pick: foo/2010-10-10-101010 .tag/bar
The behavior of any given METHOD is determined in part by the ref and dest types, i.e. branch, save, tag, etc. You know how it is β the type just changes the whole vibe check of the operation. π¦
As a special case, if ref names the βlatestβ save symlink, then bup will act exactly as if the save that βlatestβ points to had been specified, rather than the βlatestβ symlink itself. So bup get foo/latest will actually be interpreted as something like bup get foo/2013-01-01-030405. Not me thinking I'm getting the symlink β nope, you get the actual save. π
In some situations bup get will evaluate a branch operation according to whether or not it will be a βfast-forwardβ (which requires that any existing destination branch be an ancestor of the source). Iconic behavior honestly. π
An existing destination tag can only be overwritten by a --replace or --force-pick. Periodt.
When a new commit is created (i.e. via --append, --pick, etc.), it will have the same author, author date, and message as the original β but a committer and committer date corresponding to the current user and time. So like, it keeps the receipts of who originally wrote it, but the βwho actually did this just nowβ is you, right now. π
If requested by the appropriate options, bup will print the commit, tree, or tag hash for each destination reference updated. When relevant, the tree hash will be printed before the commit hash. Order matters bestie, don't get it twisted. π
Local refs can be pushed to a remote repository with the --remote option, and remote refs can be pulled into a local repository via βbup on HOST get ...β. See bup-on(1) and the EXAMPLES below for further information.
CAUTION: This is one of the fewbupcommands that can modify your archives in intentionally destructive ways. π Though if an attempt to join or restore the data you still care about succeeds after you've run this command, then that's a fairly encouraging sign that it worked correctly. (Thedev/compare-treescommand in the source tree can be used to help test before/after results.) Lowkey please test first. π«Ά
π οΈ METHODS π οΈ
--ff ref,--ff: ref destβ fast-forward dest to match ref. If dest is not specified and ref names a save, set dest to the save's branch. If dest is not specified and ref names a branch or a tag, use the same name for dest. β¨--append ref,--append: ref destβ append all of the commits represented by ref to dest as new commits. If ref names a directory/tree, append a new commit for that tree. If dest is not specified and ref names a save or branch, set dest to the ref branch name. If dest is not specified and ref names a tag, use the same name for dest. π--pick ref,--pick: ref destβ append the single commit named by ref to dest as a new commit. If dest is not specified and ref names a save, set dest to the ref branch name. If dest is not specified and ref names a tag, use the same name for dest. π―--force-pick ref,--force-pick: ref destβ do the same thing as--pick, but don't refuse to overwrite an existing tag, and if the tag refers to a commit, make it the parent of ref. Yes she's forceful, that's the whole point. π--new-tag ref,--new-tag: ref destβ create a dest tag for ref, but refuse to overwrite an existing tag. If dest is not specified and ref names a tag, use the same name for dest. π--replace ref,--replace: ref destβ clobber dest with ref, overwriting any existing tag, or replacing any existing branch. If dest is not specified and ref names a branch or tag, use the same name for dest. π₯--unnamed refβ copy ref into the destination repository, without any name, leaving a potentially dangling reference until/unless the object named by ref is referred to some other way (cf.bup tag). Currently only compatible with--copy. π»
π OPTIONS π
-spath,-Surl,--sourcepath,--source-urlurl* β use path or url as the source repository, instead of the default. Seebup(1)REPOSITORY URLS for further information. π§-r,--remote=[user@]host:[path],--remote=URLβ write the refs to the specified remote repository, by default via SSH. Seebup(1)REMOTE OPTIONS for further information. π°οΈ-c,--print-commitsβ for each updated branch, print the new git commit id. π-t,--print-treesβ for each updated branch, print the new git tree id of the filesystem root. π³--print-tagsβ for each updated tag, print the new git id. π·οΈ--copyβ copy the data without changes (i.e. without rewrites or repairs). This is the default. π«Ά--rewriteβ rewrite the data according to the destination repository configuration, e.g. itsbup.split.files, andbup.split.treesvalues. Some incidental repairs may be performed during the transfer when they do not materially alter the result (see REPAIRS below). Currently,--rewrite,---repair, or--copymust be specified whenever the source and destination repository configurations differ in a relevant way, and so far,--rewriteis only supported for appends and picks of saves (e.g. not trees). π
Note that rewriting a git-created save may, and for now will, introduce bup-related changes. Further, while tested, --rewrite is relatively new and so warrants even more caution (see CAUTION above) than bup get itself. Please consider validating the results carefully for now. β οΈ
This option is contextual (see CONTEXTUAL OPTIONS).
--repairβ in addition to what--rewritedoes, perform all known repairs during the transfer. See REPAIRS below. This option is contextual (see CONTEXTUAL OPTIONS). π©Ή--repair-id IDβ set the repair session identifier, defaults to a UUID (v4). This identifier will be included in any--repairsmade during the transfer. Currently, the identifier must be ASCII and must not include control characters or DEL (i.e. must be comprised of bytes>= 20and< 127). This option is contextual (see CONTEXTUAL OPTIONS). π--ignore-missingβ ignore missing objects encountered during a transfer. Currently only supported by--unnamed, and potentially dangerous. π--exclude-rx=patternβ exclude any path matching pattern, which must be a Python regular expression (http://docs.python.org/library/re.html). The pattern will be compared against the full path, without anchoring, so βx/yβ will match βox/yardβ or βbox/yardsβ. To exclude the contents of/tmp, but not the directory itself, use β^/tmp/.β. (may be repeated) π«
Examples:
/foo$β exclude any file named foo/foo/$β exclude any directory named foo/foo/.β exclude the content of any directory named foo^/tmp/.β exclude root-leveltmp's content
Only supported when rewriting or repairing. This option is contextual (see CONTEXTUAL OPTIONS).
--exclude-rx-from=filenameβ readβexclude-rxpatterns from filename, one pattern per-line (may be repeated). Ignore completely empty lines. Only supported when rewriting. This option is contextual (see CONTEXTUAL OPTIONS). π--no-excludesβ forget any previous--exclude-rxor--exclude-rx-fromoptions. This option is contextual (see CONTEXTUAL OPTIONS). π§½-v,--verboseβ increase verbosity (can be used more than once). With-v, print the name of every item fetched, with-vvadd directory names, and with-vvvadd every filename. π’--bwlimit=bytes/secβ don't transmit more than bytes/sec bytes per second to the server. This can help avoid sucking up all your network bandwidth. Use a suffix likek,M, orGto specify multiples of1024,1024*1024,1024*1024*1024respectively. π-#,--compress=#β set the compression level to#(a value from0-9, where9is the highest and0is no compression). Defaults to a configuredpack.compressionorcore.compression, or1(fast, loose compression). ποΈ
π CONTEXTUAL OPTIONS π
Some options like --repair and --ignore-missing can differ across METHODs, and each option changes the context for the next METHOD. So you can have:
bup get ... --ignore-missing --unnamed REF \
--no-ignore-missing --rewrite --append REF
Without --no-ignore-missing this command would fail because --ignore-missing is incompatible with --rewrite. π
Changing the currently active excludes is expensive because at the moment the cache of remembered rewrites must be cleared whenever a METHOD's excludes differ from those for the previous METHOD. (Not her being dramatic β clearing that cache for every METHOD really does cost you.) πΈ
π§ REPAIRS
okay bestie so sometimes things are broken before you even get there, and bup get can fix (or at least mitigate) a whole list of known issues while it's transferring, but only when you ask for --repair. And a little subset of "incidental" repairs can also sneak in during a --rewrite. π
- Versions of bup at or after 0.25 and before 0.30.1 might rarely drop metadata entries for non-directories (you can spot this with
bup-validate-refs(1) --bupm). The consequence is genuinely rude: it makes the metadata for all of the other non-directory paths in the same directory unusable (ambiguous). When such an abridged.bupmis detected,--repairdrops all of the.bupmentries except the one for the directory itself,., and so the affected paths lose most or all of their metadata (ownership, permissions, timestamps, etc.). These paths will have restrictive permissions (as if viaumask 077) when presented, e.g. viabup-restore(1),bup-ls(1), etc. - Use of
bup getorbup gcversions before 0.33.5 could cause repositories to end up with missing objects (detectable bybup-validate-object-links(1)). To fix affected trees,--repairsubstitutes synthesized "repair files" for any paths with missing objects. Note that there is currently no support for retrieving the unaffected parts of split files β the entire file is replaced with a repair file. π These repair files contain the--repair-idand information about the replacement. Support for split trees was added after the problem was fixed, and so should be unaffected. See the 0.33.5 release notes (0.33.5-from-0.33.4.md) for additional information.
"Incidental" repairs may also be performed β repairs that do not functionally alter the result. For example, bup records symlink targets in two places, but generally only refers to one of them. If the other one is missing, it can and will be restored from the first. β¨
π EXAMPLES π
the moment you've all been waiting for, bestie. real commands, real vibes:
# Update or copy the archives branch in src-repo to the local repository.
$ bup get -s src-repo --ff archives
# Append a particular archives save to the pruned-archives branch.
$ bup get -s src-repo --pick: archives/2013-01-01-030405 pruned-archives
# Update or copy the archives branch on remotehost to the local
# repository.
$ bup on remotehost get --ff archives
# Update or copy the local branch archives to remotehost.
$ bup get -r remotehost: --ff archives
# Update or copy the archives branch in src-repo to remotehost.
$ bup get -s src-repo -r remotehost: --ff archives
# Update the archives-2 branch on remotehost to match archives.
# If archives-2 exists and is not an ancestor of archives, bup
# will refuse.
$ bup get -r remotehost: --ff: archives archives-2
# Replace the contents of branch y with those of x.
$ bup get --replace: x y
# Copy the latest local save from the archives branch to the
# remote tag foo.
$ bup get -r remotehost: --pick: archives/latest .tag/foo
# Or if foo already exists:
$ bup get -r remotehost: --force-pick: archives/latest .tag/foo
# Append foo (from above) to the local other-archives branch.
$ bup on remotehost get --append: .tag/foo other-archives
# Append only the /home directory from archives/latest to only-home.
$ bup get -s "$BUP_DIR" --append: archives/latest/home only-home
# Resplit (rewrite) the archives branch. Note that, done all at
# once, this may require additional space up to the size of the
# archives branch. The pick methods can do the rewriting more
# selectively or incrementally. (Assume BUP_DIR has no split
# settings.)
#
$ git --git-dir "$BUP_DIR" config bup.split.trees true
$ git --git-dir "$BUP_DIR" config bup.split.files legacy:16
$ bup get --rewrite --append: archives archives-resplit
#
# Check that archives-resplit looks OK, perhaps via trial
# restores, joining it, etc. (see CAUTION above), and once
# satisfied, perhaps...
#
$ bup rm archives
$ bup gc
$ git --git-dir "$BUP_DIR" branch -m archives-resplit archives
#
# Repair a single save.
$ bup get --repair --pick archives/latest fixed
#
# Check that fixed/latest looks OK, perhaps via trial
# restores, joining it, etc. (see CAUTION above).
π that resplit one eats space up to the size of the whole branch, fr fr. plan accordingly.
πͺ EXIT STATUS
An exit status of 3 means repairs were needed and they were successful, and that no other errors occurred. so 3 is a slay, actually. π«Ά
π SEE ALSO
π
Part of the bup(1) suite. iconic behavior tbh.
π AUTHORS
Rob Browning rlb@defaultvalue.org
and that's a wrap on bup-get(1), bestie β this one's from the Bup 0.34 era, dated 2026-09-01, and you just read the whole thing. go repair something. periodt. πβ¨
π¦ where this page comes from
- fedora 44: bup 0.34-1.fc44 Β· LGPL-2.0-only
- nixpkgs unstable: bup 0.34
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms