diff options
author | xengineering <me@xengineering.eu> | 2023-02-06 20:22:51 +0100 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-02-06 20:56:54 +0100 |
commit | 19de43cb6ab28a95e8d7f9c2144386dac4ad42be (patch) | |
tree | 7f075405f74769f4a35e8bcda887510cac619971 /README.md | |
parent | 1974e434f8a6b36bd0998a7f124cd921c88eb393 (diff) | |
download | dotfiles-19de43cb6ab28a95e8d7f9c2144386dac4ad42be.tar dotfiles-19de43cb6ab28a95e8d7f9c2144386dac4ad42be.tar.zst dotfiles-19de43cb6ab28a95e8d7f9c2144386dac4ad42be.zip |
Relocate dotfiles in XDG config home
This make ~/.config a simple Git repository instead of the handling with
worktrees and bare repositories which is too complex.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 72 |
1 files changed, 62 insertions, 10 deletions
@@ -1,21 +1,73 @@ # dotfiles -A Git repository to track my personal GNU/Linux dotfiles. +A Git repository to track my personal GNU/Linux dotfiles. It should be located +in the config directory `~/.config` where programs should store their +configuration files. -## Usage +## Migrate from earlier dotfiles versions + +The dotfiles project used to create a bare Git repository in `~/dotfiles.git` +and a worktree in `~` to care about programs that place configuration files in +`~` directly. + +Now dotfiles does not care about them anymore. It is much cleaner to save +configuration files in `~/.config` and much simpler to use a simple Git +repository than using a bare repo with worktree. + +Use this command to remove a bare repository based installation of dotfiles: + +``` +rm -rf ~/dotfiles.git +``` + +After this step you can proceed with installation like described below. + +## Installation + +Start by switching to your config directory and initialize an empty Git +repository in it: + +```bash + mkdir -p ~/.config # create if it does not exist + cd ~/.config + git init +``` + +Then you should add the remote repository from xengineering.eu and fetch the +content: + +```bash + git remote add origin https://cgit.xengineering.eu/dotfiles + git fetch +``` + +Checkout the preferred branch (default is `main`). Add ` --force` after +`checkout` if the following command fails and you want to overwrite existing +files: + +```bash + git checkout main +``` + +Finally you should link some configuration files from programs which expect +their config file in `~` instead of `~/.config`: -### Installation ```bash - cd ~ # switch to home folder - git clone --bare https://cgit.xengineering.eu/dotfiles # clone the bare repository - git --git-dir=$HOME/dotfiles.git/ --work-tree=$HOME checkout # checkout dotfiles to your home - # (append '-f' to overwrite local ones) - source ~/.bashrc # enable configuration for current shell + ln -s ~/.config/.bash_profile ~/.bash_profile + ln -s ~/.config/.bashrc ~/.bashrc + ln -s ~/.config/.vimrc ~/.vimrc + ln -s ~/.config/.zshrc ~/.zshrc ``` -### Update +## Update + +Simply run this command from any location on your computer: + ```bash - dotfiles pull + git -C ~/.config pull ``` +## Add or update files + +You can use `~/.config` like a normal Git repository. |