“git init --bare $HOME/.myconf” (comment)
recommended by 6 users | 2016 | StreakyCobra on: Ask HN: What do you use to manage dotfiles? | git | original thread |
StreakyCobra on Feb 10, 2016 | on: Ask HN: What do you use to manage dotfiles? | view on HN

I use:

    git init --bare $HOME/.myconf
    alias config='/usr/bin/git --git-dir=$HOME/.myconf/ --work-tree=$HOME'
    config config status.showUntrackedFiles no

where my ~/.myconf directory is a git bare repository. Then any file within the home folder can be versioned with normal commands like:

    config status
    config add .vimrc
    config commit -m "Add vimrc"
    config add .config/redshift.conf
    config commit -m "Add redshift config"
    config push

And so one…

No extra tooling, no symlinks, files are tracked on a version control system, you can use different branches for different computers, you can replicate you configuration easily on new installation.

6 users recommended this comment. What they said:
drexlspivey Aug 2, 2018 | on: Sequoia-PGP – A new OpenPGP implementation in Rust | context

I found this brilliant way to manage your dotfiles in an old hn comment. https://news.ycombinator.com/item?id=11071754

<quote>

I use:

    git init --bare $HOME/.myconf
    alias config='/usr/bin/git --git-dir=$HOME/.myconf/ --work-tree=$HOME'
    config config status.showUntrackedFiles no

where my ~/.myconf directory is a git bare repository. Then any file within the home folder can be versioned with normal commands like:

    config status
    config add .vimrc
    config commit -m "Add vimrc"
    config add .config/redshift.conf
    config commit -m "Add redshift config"
    config push

And so one…

No extra tooling, no symlinks, files are tracked on a version control system, you can use different branches for different computers, you can replicate you configuration easily on new installation.

</quote>

claudiawerner Oct 26, 2019 | on: An Illustrated Guide to Useful Command Line Tools | context

The guide mentions a dotfile manager, but here's something I found[0] on HN a while ago that's really cool: just make your home folder a git repository.

[0] https://news.ycombinator.com/item?id=11071754

bewuethr Sep 20, 2020 | on: Ask HN: Your Favourite HN Comment? | context

This comment where I first learned about using a bare Git repo for dotfiles management: https://news.ycombinator.com/item?id=11071754

chrisan May 13, 2021 | on: Managing Dotfiles with GNU Stow (2016) | context

Having had the same problem I ended up with this nice setup https://www.atlassian.com/git/tutorials/dotfiles which is rooted in a post by HN's StreakyCobra https://news.ycombinator.com/item?id=11071754

It has served me well for a few years now

ssivark Dec 22, 2017 | on: Intermediate Vim tips | context

Across linux and OS X, I use a solution based on the this HN comment and it's follow-up discussion: https://news.ycombinator.com/item?id=11071754

Lot of other suggestions on the same HN thread: https://news.ycombinator.com/item?id=11070797

pcr910303 Dec 1, 2019 | on: Show HN: Manage Dotfiles with Stow | context

_The_ method to manage dotfiles is to use git bare repos. [0-1] Its the ideal method as:

* It doesn’t require any configuration except for a ‘git init’ once & an alias (no symlinks, no b.s.)

* Files are version-controlled

* It’s unintrusive & universal: Because it doesn’t move any files or do anything special, there’s no surprising behavior, and you can try out a few files & stop using it with an rm -rf

* and on and on...

I strongly recommend eveybody trying out, no meed for configuration/mapping, and it’s easy to try out.

[0]: https://news.ycombinator.com/item?id=11071754

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