| Crates.io | dotup |
| lib.rs | dotup |
| version | 0.1.17 |
| created_at | 2023-12-29 17:35:30.68537+00 |
| updated_at | 2024-01-02 20:32:02.214701+00 |
| description | A dotfile manager written in rust. |
| homepage | |
| repository | https://github.com/concur1/dotup |
| max_upload_size | |
| id | 1083507 |
| size | 84,470 |
A command line tool for backing up dotfiles. Inspired by yadm.
Initialize a repository
dotup init
This will:
config.toml.
After running dotup init you can run dotup status to see that config.toml exists in the dotup repo but has not been committed or added to staging.Add a file to the list of tracked files:
dotup track ~/.zshrc
Check the status of the local repo:
dotup status
Commit the change:
dotup commit -m "Initial file"
Change branch to main:
dotup branch -M main
Add the remote origin (This repo should be set up already using Codeberg/Gitlab/Github/Gitea or similar.)
dotup remote add origin git@github.com:concur1/dotfiles.git
Push to the origin:
dotup push -u origin main
.)Clone the remote repo into the local dotup repo with:
dotup clone <url> .
The config.toml file should already include a section for the file mappings under [files.hostname1].
But you should now also see that the config.toml file has been updated to include a section with the current [files.hostname2].
Add a file to the list of tracked files
dotup track <important file>
Remove a file from the list of tracked files
dotup untrack <important file>
Using the run command we can run a (git ui) application whilst the dotup repo files are being sync's with the system files.
To do this:
[program.gitui] # This is the name of the section we will be configuring
name = "gitui" # This is the name of the program that will be running
additional_args = "--watcher --logging" # These are the arguments that will be supplied to the program
cargo install gitui.dotup run gitui
By default gitui, lazygit, gitkraken and hx are already configured.
or Add files/changes to git with dotup followed by a git command
dotup status
dotup add <important file>
dotup commit
TODO:
some cases to consider:
soln1 - create a seperate repo that only contains backups of the system files.
soln2 - detect when a clone/merge is going to overwrite system files
soln3 - only copy from system to the repo and never from the repo to the system.
soln4 - use git pull --allow-unrelated-histories and disallow/raise error for clone.
soln5 - make tracking seperate. Check if the tracking files match before allowing merge/pull1.
soln6 - have apply command that will apply the local repo to the system files.
soln7 - Do not use a shared tracked files file. Instead each file will be specified locally or with a config file.