ogre
An in-memory git-like repository for objects for when you need to
keep the history around for a bit longer. The library uses json-patch RFC6902 for representing diffs.
Features
- Commit
- Branch
- Tags
- Checkout
- Reset (soft and hard)
- Diff
- Visualization via
@dotinc/ogre-react
- Merge
Usage
const repo = new Repository(new ComplexObject());
repo.data.name = "my name";
repo.data.description = "now we have a description";
const init = await repo.commit("initial commit", "author <author@test.com>");
repo.createBranch("savepoint");
repo.checkout("add_details", true);
repo.data.name = "a fancier name";
await repo.commit("change name", "author <author@test.com>");
repo.checkout("main");
repo.merge("add_details");
repo.tag("v1.0.0");
repo.checkout("main");
repo.checkout(init);
TODO