Earlier quoted context omitted.
> Right, but when you unlink it from your home directory, the file still exists in the git repo. That's a feature.
`git rm` will still leave the file available in the repo history, so violating the consistency seems more like a bug than a feature.
Using GNU Stow to manage your dotfiles (2012)
91–100 of 116 posts
Re: Using GNU Stow to manage your dotfiles (2012)
#92Call me old fashioned but what's wrong with having a regular git repo anywhere you want with all of your dotfiles and them symlink those files to where they need to go? If you wanted to you could && a few symlinks and other commands into 1 copy / paste'able command to get up and running really quickly. It's also painless to manage secrets by sourcing in optional files. It also works nicely when you want files living…
Re: Using GNU Stow to manage your dotfiles (2012)
#93You don't need symlinks, setup scripts, etc. Try this: 1. Bare git repo in your home directory ($HOME/.files) 2. Alias for prefixing git commands ("env GIT_WORK_TREE=$HOME GIT_DIR=$HOME/.files") 3. Strict .gitignore file (that ignores all files by default) Simple to add files: `h git add .vimrc` Have this set up for myself. Works great https://github.com/tmm/dotfiles
Basically adding a alias to my zshrc, that runs: `git --git-dir=$HOME/dotfiles --work-tree=$HOME`.
And then set status.showUntrackedFiles to no.
See: https://github.com/sp1ritCS/dotfiles
I've got this idea from the following blogpost: https://news.opensuse.org/2020/03/27/Manage-dotfiles-with-Gi...
Re: Using GNU Stow to manage your dotfiles (2012)
#94Call me old fashioned but what's wrong with having a regular git repo anywhere you want with all of your dotfiles and them symlink those files to where they need to go? If you wanted to you could && a few symlinks and other commands into 1 copy / paste'able command to get up and running really quickly. It's also painless to manage secrets by sourcing in optional files. It also works nicely when you want files living…
Not sure if Stow fixes these, but here are some problems I've had with that setup: 1. If you want to delete a file, you have to delete it (rm) in one place and delete it another way in another place (git rm). 2. Adding a new file in-situ (in the home directory) requires some finessing to get it back into the git repo and symlinked properly. 3. No easy way to apply a rename operation. 4. After changing the checked out…
All you need to do is to keep track of symlinks you've installed with your setup script. This can be done by creating a symlink to the symlink you've installed, which acts as a "GC root." The next time you run the setup script, it would check those "GC roots" to see if they point to a valid file and remove any dangling symlinks.
This is the approach I take for my own dotfiles. I seriously considered using Stow or the bare git approach before, but I decided against it because setting up my dotfiles involved more than just installing symlinks. I had to be able to download files (e.g., vim-plug), clone git repositories, change file permissions, and maintain files that's not meant to be linked into the home directory. I found the flexibility of a custom shell script most fit for my needs.
[1]: The "Deleting Packages" section in https://linux.die.net/man/8/stow
Re: Using GNU Stow to manage your dotfiles (2012)
#95I’ve been using stow to manage my dotfiles for a long time, works very well. Recently I’ve moved to NixOS and have been considering trying out Nix’s home-manager (mostly just out of curiosity - I’m perfectly happy with stow). If anyone has tried both stow and home-manager, I’d be interested to know your thoughts on how they compare.
Re: Using GNU Stow to manage your dotfiles (2012)
#96Obviously the Windows registry works terribly in practice, but the idea of a centralised store seems to be coming back into fashion.
Re: Using GNU Stow to manage your dotfiles (2012)
#97Earlier quoted context omitted.
> Call me old fashioned but what's wrong with having a regular git repo anywhere you want with all of your dotfiles and them symlink those files to where they need to go? I prefer to skip the symlinks, and just directly use the git repository as my home directory. (I have a sizable .gitignore for things I don't want to track.)
I do the same, but I just have a single '*' in my .gitignore. The only drawback to the homedir-as-git-repo approach I've found is that you're always in a git repo, so you have to be careful not adding stuff which was really supposed to go in another repo.
https://www.atlassian.com/git/tutorials/dotfiles
TL;DR:
alias dotfiles='/usr/bin/git --git-dir=$HOME/src/dotfiles --work-tree=$HOME'
dotfiles add
dotfiles commit
...Re: Using GNU Stow to manage your dotfiles (2012)
#98Earlier quoted context omitted.
I do the same, but I just have a single '*' in my .gitignore. The only drawback to the homedir-as-git-repo approach I've found is that you're always in a git repo, so you have to be careful not adding stuff which was really supposed to go in another repo.
Here's a better solution. https://www.atlassian.com/git/tutorials/dotfiles TL;DR: alias dotfiles='/usr/bin/git --git-dir=$HOME/src/dotfiles --work-tree=$HOME' dotfiles add dotfiles commit ...
Does anyone know if syncing a git repo over Syncthing (or similar) is a good idea or whether there are likely to be conflicts? I don't know if git names its files such that conflicts aren't possible.
Re: Using GNU Stow to manage your dotfiles (2012)
#99I originally went with the bare git repo technique, but found myself not liking how to store multiple computer's dotfiles in a single repo. I ended up switching to https://www.chezmoi.io/ , after learning about it here on HN.
Its a small, statically linked binary which is easy to install and the templating feature is really useful.
Re: Using GNU Stow to manage your dotfiles (2012)
#100Earlier quoted context omitted.
I do the same, but I just have a single '*' in my .gitignore. The only drawback to the homedir-as-git-repo approach I've found is that you're always in a git repo, so you have to be careful not adding stuff which was really supposed to go in another repo.
Here's a better solution. https://www.atlassian.com/git/tutorials/dotfiles TL;DR: alias dotfiles='/usr/bin/git --git-dir=$HOME/src/dotfiles --work-tree=$HOME' dotfiles add dotfiles commit ...