git-annex-filter-branch(1) | General Commands Manual | git-annex-filter-branch(1) |
git-annex-filter-branch - filter information from the git-annex branch
git annex filter-branch [...]
This copies selected information from the git-annex branch into a git commit object, and outputs its hash. The git commit can be transported to another git repository, and given a branch name such as "foo/git-annex", and git-annex there will automatically merge that into its git-annex branch. This allows publishing some information from your git-annex branch, without publishing the whole thing.
Other ways to avoid publishing information from a git-annex branch, or remove information from it include git-annex-forget(1), the annex.private git config, and the --private option to git-annex-initremote(1). Those are much easier to use, but this provides full control for those who need it.
With no options, no information at all will be included from the git-annex branch. Use options to specify what to include. All options can be specified multiple times.
When the repository contains information about a private repository (due to annex.private being set, or git-annex initremote --private being used), that private information will be included when allowed by the options, even though it is not recorded on the git-annex branch.
When a repository was created with git annex initremote --sameas=foo, its information will be included when the information for foo is, and excluded when foo is excluded.
When a special remote is configured with importtree=yes or exporttree=yes, normally the git tree corresponding to the repository is included in the git-annex branch, to make sure it does not get garbage collected by git gc. Those trees are *not* included when filtering the git-annex branch. Usually this will not cause any problems, but if such a tree does get garbage collected, it will prevent accessing files on the special remote, until the next time a tree is imported or exported to it.
You have a big git-annex repository and are splitting the directory "foo" out, to make a smaller repository. You want the smaller repo's git-annex branch to contain all the information about remotes and other configuration, but only information about keys in that directory.
git-annex filter-branch foo --include-all-key-information
--include-all-repo-config --include-global-config
That only includes information about the keys that are currently in the directory "foo", not keys used by old versions of files. To also include information about the version of the subdir in tag "1.0", add the option --branch=1.0:foo
Your repository has a special remote "bar", and you want to share information about which annexed files are stored in it, but without sharing anything about the configuration of the remote.
git-annex filter-branch --all --include-all-key-information
--include-all-repo-config --exclude-repo-config-for=bar
--include-global-config
Joey Hess <id@joeyh.name>