2023-03-23 09:49:43 +01:00
|
|
|
# Bare Git Repository
|
|
|
|
|
|
|
|
- https://www.atlassian.com/git/tutorials/dotfiles
|
|
|
|
- StreakyCobra
|
|
|
|
|
|
|
|
## Starting from scratch
|
|
|
|
|
|
|
|
```
|
|
|
|
git init --bare $HOME/.dotfiles
|
|
|
|
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
|
|
|
|
dotfiles config --local status.showUntrackedFiles no
|
|
|
|
```
|
|
|
|
|
|
|
|
## Install onto a new system
|
|
|
|
|
2023-03-26 18:23:32 +02:00
|
|
|
The `checkout` command is expected to fail with a message.
|
|
|
|
This is because your $HOME folder might already have some stock configuration
|
|
|
|
files which would be overwritten by Git.
|
|
|
|
The “BKDIR” part is a rough shortcut to move all the offending files
|
|
|
|
automatically to a backup folder:
|
|
|
|
|
2023-03-23 09:49:43 +01:00
|
|
|
```
|
2023-03-26 18:23:32 +02:00
|
|
|
git clone --bare <git-repo-url> $HOME/.dotfiles
|
|
|
|
|
2023-03-23 09:49:43 +01:00
|
|
|
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
|
|
|
|
|
|
|
|
dotfiles config --local status.showUntrackedFiles no
|
|
|
|
|
2023-03-26 18:23:32 +02:00
|
|
|
BKDIR=".dotfiles-backup/";
|
|
|
|
dotfiles checkout 2>&1 | egrep "\s+" | awk {'print $1'} |
|
|
|
|
xargs -I{} sh -c "mkdir -p \$(dirname ${BKDIR}{}); mv -iv {} ${BKDIR}{}";
|
2023-03-23 09:49:43 +01:00
|
|
|
|
2023-03-26 18:23:32 +02:00
|
|
|
dotfiles checkout
|
2023-03-23 09:49:43 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
## Other Tools
|
|
|
|
|
|
|
|
```
|
|
|
|
lazygit --git-dir=$HOME/.dotfiles --work-tree=$HOME
|
|
|
|
```
|
|
|
|
|