Hacker News new | past | comments | ask | show | jobs | submit login

You 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




This is similar to a resource that atlassian has put out on storing dotfiles [1]. It is also similar to what I use and I can vouch for this method as well.

[1] https://www.atlassian.com/git/tutorials/dotfiles


Not sure if I got it from the atlassian post or the original hacker news post - I am aware of both. It don't see the need for anything more complex. My first config commit is in early 2017.


I've been doing something similar.

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...


This is the simplest way of doing it and in my opinion the best. You can just have all of the files where they are supposed to be without the need of symlinks or anything. I've been doing it this way (well a bit different but very similar) and it works like a charm.

I explain here the steps of how I do it: https://github.com/josepmdc/dotfiles#2-if-you-want-to-manage...




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: