by 5e92cb50239222b · 4y ago · 0 comments
https://www.atlassian.com/git/tutorials/dotfiles
tl;dr: it puts the .git directory aside and lets you use it to store any files on your filesystem.
All the usual commands work, except you use something like `config` or `dofiles` instead of `git`:
$ config add ~/.config
$ config commit -m initial\ commit
It's pretty much the same as creating a git repository in /, but doesn't mess with your normal git usage (so if you run `git status` in `/home/foo/src/my-awesome-project` and git repository has not been created there yet, git will fail with "not a git repository" and won't show you the contents of your whole filesystem tree).I didn't know about `git config --local status.showUntrackedFiles no` so I just put '/*' into .home.git/info/exclude, and then of course tracked that in itself by adding '!/.home.git/info/exclude' in there too.
It's been amazingly useful when acquiring a new laptop, or wanting to quickly set up a comfortable environment on remote machines.
Interestingly, I got it from a Stackoverflow answer (https://stackoverflow.com/a/27336975/8002) and not the atlassian tutorial you listed.
$ git remote add foobar address:path/relative/to/home/dir
$ git push foobar
, or self-host Gitea with registration closed if you want a proper forge.Is this a problem if you gitignore * (whitelisting)?