|Samuel Roland 5e680136a6|
After reading The best way to store your dotfiles: A bare Git repository - Atlassian, I decided it was the good solution to manage my dotfiles between my machines...
This is part of the dotfiles bare repos (stored in
How it works ?
There is a bare Git repository called
dotfiles (bare means it's not the normal type of repos). The files are not stored inside the folder
dotfiles when we clone it (it contains what
.git contains normally). Versionned files are stored in the
$HOME directory (meaning
sam is the username).
A visual example: /home/sam Documents Desktop ... .bashrc .kdenliverc
Side note: Github Desktop doesn't support bare repository
How to use
Use these files on a new Fedora 36 machine
Add new files to versionning
config add /path/to/file
How to commit changes ?
config commit -m "Update .kdenliverc"
A way to commit all tracked files without adding them one by one:
config commit -a -m "Update .kdenliverc"
How to manage variants depending on different machines
Let's say my machine A wants all my defaults and my machine B want the defaults but with a little change in a given config file...
Just use branches ! Let's define that
main is the base for every machine I use. Now, we can create another branch called
fedoralaptop where do merge from main into
fedoralaptop to update the default, but keep some variants.
.config/kwriterc is untracked locally because a few useless lines changes all the times. See more on https://stackoverflow.com/questions/6557467/can-git-ignore-a-specific-line
The command for this is
git update-index --assume-unchanged .config/kwriterc to ignore modifications in the file. To disable this we can run
git update-index --no-assume-unchanged .config/kwriterc.
Files managed in this repository