1. 9
  1. 6

    This is practically the exact same procedure as the one described by an Atlassian post on the same subject.

    1. 5

      Seems like the original source of both posts is a HN comment.

      1. 1

        I think any article that talks about dotfiles is very similar.

      2. 2

        this is kind of brilliant.

        I remember seeing a comment or blog a long time ago wherein the author just does a git init in their home dir and sets their gitignore to everything. That leaves you with the artifact of a .git folder in your home dir though.

        I’m not bothered by symlinking my dotfiles because I have a bash script that does that. But this just keeps things really clean and tidy. I’m not surprised to learn that you can set up different git dirs and working dirs with git, but I don’t think I’ve ever seen that before.

        1. 1

          we use the entire $HOME as work tree.

          Oops, no, don’t do that. Bad idea. Most people have their code under $HOME/code/ or $HOME/src/ or something like that. You definitely don’t want to confuse git and mess up your repos by having a repo nested inside another.

          Instead I recommend going to a little bit of effort to keep your dotfiles repo separate as just a normal repo along with the others, and linking them up using the ‘include’ functionality that pretty much every good config format comes with.

          For example, I have my canonical bashrc under ~/src/dotfiles/bashrc and load it on my Mac with:

          # ~/.bash_profile
          source ~/src/dotfiles/bashrc

          The reason I don’t recommend symlinks is that the extra layer of config gives you flexibility to have some changes on one machine only without having to commit to having them everywhere.

          See https://github.com/yawaramin/dotfiles for more.