In the case where one wants to create a tree commit derived from other content, using rofiles-fuse in concert with ostree commit --link-checkout-speedup (or the underlying API) can ensure that only new files are checksummed.
# Initialize a checkout and mount $ ostree --repo=repo checkout somebranch branch-checkout $ mkdir mnt $ rofiles-fuse branch-checkout mnt # Now, arbitrary changes to mnt/ are reflected in branch-checkout $ echo somenewcontent > mnt/anewfile $ mkdir mnt/anewdir $ rm mnt/someoriginalcontent -rf # Commit and cleanup $ fusermount -u mnt $ ostree --repo=repo commit --link-checkout-speedup -b somebranch -s 'Commit new content' --tree=dir=branch-checkout $ rm mnt branch-checkout -rf
ostree(1)