Guest
Lvl 0

0 / 0
forkonce
(Lvl 12)
Posted
6
Best way to manage dotfiles using just Git
https://v.redd.it/m0z2x49djaj71
r/linux - Best way to manage dotfiles using just Git
       
Post a reply.
29

I use this method and it works well.

My version of the script, pretty much the same:

❯ cat ~/.config/fish/functions/hit.fishfunction hit/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $argvend

I've tried other methods using stow or symbolic links and such things. This is much cleaner and easier/quicker to use.

I like to leave 'show untracked files' on when I run 'status', so I can spot things I may want to backup easily. I just dump directories I know I won't want to track into gitignore.

For a git hoster I just use a vm running openssh. Simple enough.

30

https://github.com/sitaramc/notes/blob/master/dac.mkd, code at https://github.com/sitaramc/notes/blob/master/dac

# cloc dac
Language                      files          blank        comment           code
--------------------------------------------------------------------------------
Bourne Again Shell                1             14             22             29
--------------------------------------------------------------------------------

The one feature that I really need in a dotfile manager is to allow keeping local changes temporarily -- no other tool seems to allow that. In 29 lines of shell, I get everything I ever needed in a dotfile manager :)

39

As a more all-encompassing alternative, there's always NixOS. It's not just your home dot files in GIt, but your /etc and the rest of your machine configuration + hardware setup as well.

9

I wrote my own solution so I can store them in modules, referencing eachother. It also runs scrips, so entire systems can be installed using only this. And different ones at that, you can restrict stuff to only run when specific conditions match, like we have pacman, or systemd, or its a mac.

https://github.com/AlexAegis/dotfiles

https://github.com/AlexAegis/pont

31

I do love some chezmoi though.

17

I'm currently happy with yadm. It basically does the same thing, and has some extra features some might find useful. I used just git before and then chezmoi for a while.

I find that having dot files under version control is the most important part. The way you manage them (custom aliases, stow, chezmoi, yadm) is a personal preference and it's great that there are many options.

13

I managed my dotfiles like this for a while, but recently I've taken a liking to having my dotfiles folder in ~/docs/git and hardlinking them to their respective names in ~/.config

Stats
Post Views: 13
Comments: 7

Upvotes: 2
Downvotes: 0

Decay Rate: 1
Current Score: 0
Top Score: 6
Top Post Tips
Top Comment Tips