diff options
| author | Danilo M. <danix@danix.xyz> | 2026-05-06 09:54:00 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-05-06 09:54:00 +0200 |
| commit | fdde3a49d44e7e1404d7665880158a5b84c3dcad (patch) | |
| tree | 94ec9782ba2b2763ee833d75e5a3fb7d581d5017 /README.md | |
| parent | 78742f69a5080fe0bdab7dac61400028ee107a37 (diff) | |
| download | dots-backup-fdde3a49d44e7e1404d7665880158a5b84c3dcad.tar.gz dots-backup-fdde3a49d44e7e1404d7665880158a5b84c3dcad.zip | |
Add GIT_REMOTE, GIT_BRANCH config options and --push flag
- GIT_REMOTE in config auto-registers origin on every run (idempotent)
- GIT_BRANCH sets push target branch (defaults to current branch)
- -p/--push pushes after commit; errors if no remote available
- Updated config.example and README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -64,6 +64,7 @@ git push -u origin master -v, --verbose Print each file as rsync transfers it -r, --restore Restore dotfiles from backup to original locations -q, --quiet Suppress stdout; write output to log instead + -p, --push Push to remote after commit -h, --help Show this help ``` @@ -82,12 +83,20 @@ Or automate with cron (silent, logs to `~/.local/share/dot-backup/backup.log`): 0 * * * * /path/to/dot-backup.sh -q ``` -After backup, push manually: +Push manually after backup: ```bash cd ~/Programming/GIT/my-dotfiles && git push ``` +Or set `GIT_REMOTE` in config and use `-p` to push automatically: + +```bash +./dot-backup.sh -p +# or combined with cron: +./dot-backup.sh -q -p +``` + ## Restoring on a New Machine Preview what would be restored first: @@ -118,8 +127,12 @@ Available options: DEFAULT_OUTPUT_DIR="${HOME}/Programming/GIT/my-dotfiles" LOG_FILE="${HOME}/.local/share/dot-backup/backup.log" DOTFILES_LIST="${HOME}/.config/dot-backup/files.list" +GIT_REMOTE="git@github.com:you/my-dotfiles.git" +GIT_BRANCH="master" ``` +`GIT_REMOTE` — if set, script ensures it is registered as `origin` on every run. Required for `--push`. `GIT_BRANCH` defaults to the current branch if unset. + ## Adding Files **Edit the script** — add paths to the `DOTFILES` array in `dot-backup.sh`. |
