I started to use a git repo to backup config files, also in "/etc", using "/" as work-tree, and created an alias, called "git-backup", to this command:
git --work-tree=/ --git-dir=/home/user/repo/.git
This seems to work well for few years but now it's broken: I can't add file, well really can't add ".config" files, even with -f option; and if I try to add a folder inside home directory:
git-backup add src/linux-5.10.147 The following paths are ignored by one of your .gitignore files: home hint: Use -f if you really want to add them. hint: Turn this message off by running hint: "git config advice.addIgnoredFile false"
git-backup config --global core.excludesfile ~/.gitignore_global
and ".gitignore_global" file is:
# First, ignore everything * # Now, whitelist anything that's a directory #!*/ # And all the file types you're interested in. !/etc/* !/home/user/*
The file ".git/info/exclude" has all lines commented out.
I'm using a repo with only readme file, I clone it, and point git-dir defined in the alias to the .git dir in the cloned repo.
Any advise or suggestions?