108 lines
2.5 KiB
Markdown
108 lines
2.5 KiB
Markdown
# 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
|
|
|
|
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:
|
|
|
|
```
|
|
git clone --bare <git-repo-url> $HOME/.dotfiles
|
|
|
|
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
|
|
|
|
dotfiles config --local status.showUntrackedFiles no
|
|
|
|
BKDIR=".dotfiles-backup/";
|
|
dotfiles checkout 2>&1 | egrep "\s+" | awk {'print $1'} |
|
|
xargs -I{} sh -c "mkdir -p \$(dirname ${BKDIR}{}); mv -iv {} ${BKDIR}{}";
|
|
|
|
dotfiles checkout
|
|
```
|
|
|
|
## Useful Commands
|
|
|
|
- List all tracked files (from CWD):
|
|
`dotfiles ls-tree --name-only -rz main | xargs -0 $(whence lsd) -lU`
|
|
|
|
## Other Tools
|
|
|
|
```
|
|
lazygit --git-dir=$HOME/.dotfiles --work-tree=$HOME
|
|
```
|
|
|
|
# Install recent versions of applications
|
|
|
|
## Generic Tips
|
|
|
|
### Github Patches
|
|
|
|
From [stackoverflow](https://stackoverflow.com/questions/28484186/apply-github-commit-pull-request-as-a-patch).
|
|
|
|
```
|
|
wget https://github.com/jesseduffield/lazygit/pull/2604.patch
|
|
git apply --stat --apply 2604.patch
|
|
```
|
|
|
|
|
|
## Fonts
|
|
|
|
- [How to install and manage fonts on Linux](https://linuxconfig.org/how-to-install-and-manage-fonts-on-linux)
|
|
- `mv folder ~/.fonts`
|
|
- `fc-cache -fv ~/.fonts`
|
|
|
|
- [JetBrains Mono](https://www.jetbrains.com/lp/mono/)
|
|
- Install the files **without “NL”** (i.e No Ligatures) in their names
|
|
|
|
- [Nerd Fonts](https://www.nerdfonts.com/)
|
|
- [Download](https://github.com/ryanoasis/nerd-fonts/tags)
|
|
- NerdFontsSymbolsOnly.tar.xz
|
|
- [Cheat Sheet](https://www.nerdfonts.com/cheat-sheet)
|
|
- https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/bin/scripts/test-fonts.sh
|
|
|
|
|
|
## kitty
|
|
|
|
- https://sw.kovidgoyal.net/kitty/binary/
|
|
|
|
```
|
|
sudo apt-get install kitty-terminfo
|
|
sh ~/.config/kitty/installer.sh
|
|
```
|
|
|
|
**Note**:
|
|
Kitty prepends its _bin_ folder to the path.
|
|
So it is more coherent/simpler to copy this behaviour into Zsh.
|
|
|
|
|
|
## lazygit
|
|
|
|
### Go
|
|
|
|
```
|
|
go install github.com/jesseduffield/lazygit@latest
|
|
```
|
|
|
|
### Manual
|
|
|
|
```
|
|
mkdir -p $HOME/dev_3rd/golang
|
|
cd $HOME/dev_3rd/golang
|
|
git clone https://github.com/jesseduffield/lazygit.git
|
|
cd lazygit
|
|
go install
|
|
```
|