|
||
---|---|---|
.config | ||
.local/share | ||
.var/app | ||
.bashrc | ||
.gitignore | ||
README.md |
README.md
Dotfiles
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 $HOME/dotfiles
).
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 /home/sam
where 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
todo
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"
Final push:
config push
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.
Special files
For ex. .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
VSCodium
-
VSCodium
settings.json
file:.var/app/com.vscodium.codium/config/VSCodium/User/settings.json
-
VSCodium
keyb.json
file: -
...