TheLocehiliosan / yadm

Yet Another Dotfiles Manager
https://yadm.io/
GNU General Public License v3.0
4.94k stars 178 forks source link

How can I manage the /etc directory while using etckeeper? #383

Closed funcrab closed 2 years ago

funcrab commented 2 years ago

This question is about

Describe your question

I want to use yadm to manage /etc directory as root user. When I install etckeeper, the /etc/.git directory exists, so yadm add /etc/something doesn't add it. I'm not sure if this is a basic knowledge of git, but if you have a solution, please let me know! Thanks for the useful tool.

funcrab commented 2 years ago

I've written the following shell script to give me a temporary fix for now

mv /etc/.git /etc/.git_esc mv /etc/.gitignore /etc/.gitignore_esc

/usr/bin/yadm $*

mv /etc/.git_esc /etc/.git mv /etc/.gitignore_esc /etc/.gitignore

TheLocehiliosan commented 2 years ago

Do you mean you are using yadm with an alternate worktree (-w) ? yadm shouldn't have any problems tracking files that are within other Git repo work trees (even if they are tracked by that other repo). I'm trying to understand the issue you're running into.

funcrab commented 2 years ago

The problem was fixed by running the following commands and reinstalling the OS.

yadm fetch origin
yadm reset --hard origin/master

It seems that there was a discrepancy between origin and master in the git repository. Thank you for your kindness. This tool is great.