*
git tracks modifications to your dotfiles. And on the rare occasion that you need to add a new file, just force-add it: git add -f ~/.foorc
If you need a script to "install" your dotfiles, you're doing it wrong. *
git tracks modifications to your dotfiles. And on the rare occasion that you need to add a new file, just force-add it: git add -f ~/.foorc
If you need a script to "install" your dotfiles, you're doing it wrong.I've been using stow for years to manage my dotfiles and it's never been more involved than
$ stow dotfiles/urxvt
or what have you. In fact I would say that managing a git repository is more of a waste of time and far more over-engineered for a task easily solved by a tiny binary.
Not sure what you're referring to by an 'install script', have you ever used stow?
In any case, the real answer is that you should be using whatever works best for your use case, and for me that's stow.
Undefined subroutine &main::error called at /usr/bin/stow line 568, <DATA> line 18.
where line 568 of /usr/bin/stow is: error("Slashes are not permitted in package names");
What version of stow do you have? I'm using stow 2.2.0-r2 on Gentoo Linux.>A package directory is the root of a tree containing the installation image for a particular package. Each package directory must reside in a stow directory — e.g., the package directory /usr/local/stow/perl must reside in the stow directory /usr/local/stow. The name of a package is the name of its directory within the stow directory — e.g., perl.
https://www.gnu.org/software/stow/manual/stow.html
The article in the OP also doesn't use this format. Instead it's prefaced with a `cd` command, so you would need to do:
cd foo; stow barexport GIT_CEILING_DIRECTORIES=~
to your .bashrc (or equivalent)
If your project has its own .git directory, no, it won't add to ~/.git.
So I have a script that manages the symlinks for multiple such repos, knows to remove the broken links as needed, and I have something I can just paste into the terminal of any machine and it'll set that box up with my public/work/private dotfiles as appropriate.
It's not perfect, but it works, just pointing out that even for relatively simple cases having a dotfile manager (or writing your own) can make sense.
My .bashrc will run a bootstrap_work_dotfiles function when bash starts: https://github.com/avar/dotfiles/blob/master/.bashrc#L410
This then clones my ~/g/avar-dotfiles-work repo if I'm at work and it hasn't been cloned: https://github.com/avar/dotfiles/blob/master/.bashrc#L355
I have a "dud" function (dotfile update) function that'll update both, it basically does a git pull, re-chmods ~/.ssh/config: https://github.com/avar/dotfiles/blob/master/.bashrc#L381
And also, and what you asked for, removes any stale symlinks via this one-liner: https://github.com/avar/dotfiles/blob/master/.bashrc#L348
Basically doing a find on my ~ directory and finding any broken links pointing to the known location of the overlay repo.
I see now that there's a potential bug in it where it narrows its search in such a way that it could miss it if you add/remove new ~/.??* files. This could be solved, but I have it like that because I only ever add/remove stuff in e.g. ~/.bashrc.d/ or ~/.screenrc.d/, so this way the find takes less time to run.
Then I have a generated one-liner that I can paste into new machines that clones my dotfiles.git into ~/g/, moves the .git to ~/, then sources bashrc which bootstraps the rest.