git-annex-push(1)
π NAME
git-annex-push β push content to remotes π (yes bestie, that's the whole vibe: it pushes content)
okay so quick note before we dive in β this whole page lives in the git-annex manual, section 1, and it's giving "the glow-up your git push never had". let's go β¨
πΈ SYNOPSIS
git annex push [remote ...]
π¦ DESCRIPTION
okay so this command pushes content to remotes β and it's not just doing one thing. It uploads both the git repository content and the content of your annexed files. two-for-one slay π
You could totally just run git push and git-annex copy by hand to do the exact same thing, ngl. But this command handles a bunch of little details for you β including making sure the git-annex branch actually gets pushed to the remote. like, it's the responsible friend who remembers the stuff you'd forget π
So here's a thing that surprises people: with git-annex, remotes are often not bare repositories. That's on purpose β it's genuinely helpful to add remotes for nearby machines where you want the same annexed content to live. But pushing to a non-bare remote will not normally update that remote's current branch with changes from your local repository. (Unless, that is, the remote is configured with receive.denyCurrentBranch=updateInstead β then it's a different story.) Instead, when it detects a remote like that, this command pushes to the remote's synced/master (and similar with other branches). Then when git-annex pull (or git-annex sync) is later run on the remote, it merges the synced/ branches that got pushed to it. teamwork, but make it version control π«Ά
Some special remotes let you export a whole tree of files to them (exporttree=yes), and this command can push to those remotes too, as well as to regular git remotes. For the full tea on how those special remotes work, go read git-annex-export(1). But heads up β for this command to export to a special remote, remote.<name>.annex-tracking-branch also has to be configured, and it must have the same value as the branch you currently have checked out. no matching branch, no export, periodt π
If git-annex-adjust(1) has been used to check out an adjusted branch, this command propagates changes that were made back to the parent branch β without propagating the adjustments themselves. iconic behavior honestly π
Normally, this tries to upload the content of each annexed file that's in the working tree, to any remote it's pushing to that doesn't already have a copy. Want to control which files get uploaded to a given remote? Configure that remote's preferred content. And plot twist: when a file is not the preferred content of a remote, this command will try to drop that file's content from it π So yeah, preferred content settings are kind of a big deal β see git-annex-preferred-content(1).
β¨ OPTIONS β¨
[remote]β so by default this command pushes to all available remotesβ¦ minus the ones that haveremote.<name>.annex-push(orremote.<name>.annex-sync) set tofalse, and minus the ones withremote.<name>.annex-readonlyset totrue(read-only remotes said "not today" π ββοΈ). But if you specify remote names (or remote groups), you get to pick exactly which ones to push to. choose your fighters, bestie π--fastβ only push to the remotes with the lowestannex-costvalue configured. πββοΈ When you give a list of remotes (or remote groups), it picks from among those; otherwise it picks from among all remotes. fastest one wins, no cap β‘--only-annex,-a,--not-only-annexβ only push thegit-annexbranch and annexed content to remotes, and not other git branches. π Theannex.synconlyannexconfiguration can be set totrueto make this the default behavior β and if you ever need to override a setting like that, just use--not-only-annex. Also: when this is combined with--no-content, only thegit-annexbranch gets pushed. that's it. that's the whole push π«‘--no-content,-g,--contentβ use--no-contentor-gto avoid uploading (and dropping) the content of annexed files. π If you find yourself using--no-contenta lot, you can set theannex.synccontentconfiguration tofalseso content doesn't get uploaded by default β and the--contentoption overrides that configuration. π--content-of=path,-C pathβ only upload (or drop) annexed files in the given path. π This option can be repeated multiple times with different paths. But note: this option does not prevent exporting other files to an"exporttree=yes"remote. (sneaky little caveat, keep it in mind π)--all,-Aβ usually this command operates on annexed files in the current branch. This option makes it operate on all available versions of all annexed files (when preferred content settings allow). β Also note: preferred content settings that useinclude=orexclude=will only match the version of files currently in the work tree β but not past versions of files. yeah. that one's important, don't skip it π--jobs=N,-JNβ enables parallel pushing with up to the specified number of jobs running at once. For example:-J10π₯ Setting this to"cpus"will run one job per CPU core. go off, multicore queen π--cleanupβ removes the local and remotesynced/branches, which were created and pushed bygit-annex pushorgit-annex sync. π§Ή This option prevents all other activities. like, it's the only thing it'll do. one-track mind π
Also β the git-annex-common-options(1) can be used. don't forget the shared options, bestie, they're free real estate π
π SEE ALSO
git-annex(1)git-annex-pull(1)git-annex-sync(1)git-annex-preferred-content(1)git-annex-satisfy(1)
π AUTHOR
Joey Hess <id@joeyh.name> β the main character who wrote all of this π«Ά
ok that's the whole page!! source is the git-annex manual, and the footer line just says git-annex-push(1) (the man page title itself). no invented dates here, bestie β just the facts, wrapped in glitter. stay synced πβ¨ππ¦
π¦ where this page comes from
- alpine 3.24: git-annex-doc 10.20261026-r0 Β· AGPL-3.0-or-later
- arch rolling: git-annex 10.20261026-2 Β· AGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms