https://github.com/tkellogg/dura Skip to content Sign up * Why GitHub? + Features + Mobile + Actions + Codespaces + Packages + Security + Code review + Issues + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Learning Lab + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} tkellogg / dura Public * Notifications * Fork 10 * Star 630 * You shouldn't ever lose your work if you're using Git View license 630 stars 10 forks Star Notifications * Code * Issues 6 * Pull requests 1 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 0 tags Code Latest commit @tkellogg tkellogg Merge pull request #11 from Dowwie/refactor_main ... 707160c Jan 3, 2022 Merge pull request #11 from Dowwie/refactor_main cleaned up main a bit 707160c Git stats * 30 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time src Merge pull request #11 from Dowwie/refactor_main Jan 3, 2022 .gitignore Initial commit Dec 31, 2021 Cargo.lock Fix panic if config dir inexistant: create_dir_all Jan 3, 2022 Cargo.toml Renamed to dura Jan 2, 2022 LICENSE Add license Jan 1, 2022 README.md Merge branch 'master' into patch-1 Jan 3, 2022 View code [ ] Dura How to use How to recover Install FAQ Is this stable? How often does this check for changes? Does this work on my OS? README.md Dura Dura is a background process that watches your Git repositories and commits your uncommitted changes without impacting HEAD, the current branch, or the Git index (staged files). If you ever get into an "oh snap!" situation where you think you just lost days of work, checkout a dura branch and recover. Without dura, you use Ctrl-Z in your editor to get back to a good state. That's so 2021. Computers crash and Crl-Z only works on files independently. Dura snapshots changes across the entire repository as-you-go, so you can revert to "4 hours ago" instead of "hit Ctrl-Z like 40 times or whatever". Finally, some sanity. How to use Launch the daemon: $ dura serve & The serve can happen in any directory. The & is bash syntax to "daemonize" the process, meaning that you can start dura and then keep using the same terminal window while dura keeps running. You could also run dura serve in a window that you keep open. Let dura know which repositories to watch: $ cd some/git/repo $ dura watch Right now, you have to cd into each repo that you want to watch, one at a time. If you have thoughts on how to do this better, share them here. Make some changes. No need to commit or even stage them. Use any Git tool to see the dura branches: $ git log --all dura produces a branch for every real commit you make and makes commits to that branch without impacting your working copy. You keep using Git exactly as you did before. How to recover The dura branch that's tracking your current uncommitted looks like dura-f4a88e5ea0f1f7492845f7021ae82db70f14c725. In bash, you can get the branch name via: $ echo "dura-$(git rev-parse HEAD)" Use git log or tig to figure out which commit you want to rollback to. Copy the hash and then run something like # Or, if you don't trust dura yet, `git stash` $ git reset HEAD --hard # get the changes into your working directory $ git checkout $THE_HASH # last few commands reset HEAD back to master but with changes uncommitted $ git checkout -b temp-branch $ git reset master $ git checkout master $ git branch -D temp-branch If you're interested in improving this experience, collaborate here. Install 1. Install rust (e.g., brew install rustup) 2. Clone this repository 3. Run cargo install --path . FAQ Is this stable? It's still in the prototype phase. Open issues pertaining to stability are marked with the stability tag. How often does this check for changes? Every now and then, like 5 seconds or so. Internally there's a control loop that sleeps 5 seconds between loops, so it runs less frequently than every 5 seconds (potentially a lot less frequently, if there's a lot of work to do). Does this work on my OS? * Mac: yes * Linux: probably * Windows: possibly About You shouldn't ever lose your work if you're using Git Topics git rust Resources Readme License View license Stars 630 stars Watchers 5 watching Forks 10 forks Releases No releases published Packages 0 No packages published Contributors 5 * @tkellogg * @kerneis * @darti * @Dowwie * @vladdoster Languages * Rust 100.0% * (c) 2022 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.