4 ms·
I very much prefer this simple method: https://www.atlassian.com/git/tutorials/dotfiles https://www.atlassian.com/git/tutorials/dotfiles tl;dr: it puts the .g
by 5e92cb50239222b 4y ago
I very much prefer this simple method:
https://www.atlassian.com/git/tutorials/dotfiles 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).
- politelemon 4y agoThanks for sharing that. Question, where do you normally push the "repo" to?
- bryankaplan 4y agoI'm not the person you asked, but it's trivial to host your own git repos on a server.
- 5e92cb50239222b 4y agoDoesn't matter in my case, there are no secrets there (so I use a public git forge). If this doesn't work for you, you can just push to any old server via ssh: $ 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.
- lvass 4y ago>if you run `git status` Is this a problem if you gitignore * (whitelisting)?
- 5e92cb50239222b 4y agoI used this initially (before running into the link above), but it still requires using a 'global' git repository which had its share of issues (some build scripts didn't like it, for example).
- publicdaniel 4y agoThis is what I do, it has worked great for me. The only annoying thing is I can’t get tab completing to work in my shell (ZSH). Something about the alias I think.
- pjz 4y agoI've been doing this for a few years now and definitely agree! I use .home.git as my .git-aside name and also named the access alias 'homegit'. 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 https://stackoverflow.com/a/27336975/8002) and not the atlassian tutorial you listed.