md formatting for cmds
This commit is contained in:
@@ -1,32 +1,32 @@
|
|||||||
# Dotfiles Management
|
# Dotfiles Management
|
||||||
## Create new bare repo
|
## Create new bare repo
|
||||||
### 1. Initialize a bare repo in your home directory
|
### 1. Initialize a bare repo in your home directory
|
||||||
git init --bare $HOME/.dotfiles
|
`git init --bare $HOME/.dotfiles`
|
||||||
|
|
||||||
### 2. Create an alias (add this to your .bashrc / .zshrc)
|
### 2. Create an alias (add this to your .bashrc / .zshrc)
|
||||||
alias config='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
|
`alias config='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'`
|
||||||
|
|
||||||
### 3. Hide untracked files (so 'config status' isn't noisy)
|
### 3. Hide untracked files (so 'config status' isn't noisy)
|
||||||
config config --local status.showUntrackedFiles no
|
`config config --local status.showUntrackedFiles no`
|
||||||
|
|
||||||
### 4. Start tracking files
|
### 4. Start tracking files
|
||||||
config add ~/.config/nvim/init.lua
|
`config add ~/.config/nvim/init.lua`
|
||||||
config add ~/.config/alacritty/alacritty.toml
|
`config add ~/.config/alacritty/alacritty.toml`
|
||||||
config commit -m "Add nvim and alacritty config"
|
`config commit -m "Add nvim and alacritty config"`
|
||||||
config push
|
`config push`
|
||||||
|
|
||||||
## Clone to a new machine
|
## Clone to a new machine
|
||||||
### Clone repo
|
### Clone repo
|
||||||
git clone --bare https://github.com/you/dotfiles.git $HOME/.dotfiles
|
`git clone --bare https://github.com/you/dotfiles.git $HOME/.dotfiles`
|
||||||
|
|
||||||
### Set up the alias again, then checkout
|
### Set up the alias again, then checkout
|
||||||
alias config='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
|
`alias config='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'`
|
||||||
config checkout
|
`config checkout`
|
||||||
|
|
||||||
### If there are conflicts with existing files, back them up first
|
### If there are conflicts with existing files, back them up first
|
||||||
mkdir -p ~/.config-backup && \
|
`mkdir -p ~/.config-backup && \`
|
||||||
config checkout 2>&1 | grep "\s\+\." | awk '{print $1}' | \
|
`config checkout 2>&1 | grep "\s\+\." | awk '{print $1}' | \`
|
||||||
xargs -I{} mv {} ~/.config-backup/{}
|
`xargs -I{} mv {} ~/.config-backup/{}`
|
||||||
```
|
```
|
||||||
|
|
||||||
## Key Principles
|
## Key Principles
|
||||||
|
|||||||
Reference in New Issue
Block a user