- bash(You don't need to run bash, but dotbare does require you have bash in your system)
- Optional dependency
- [fd](https://github.com/sharkdp/fd) (Faster local file search, if you have `fd`, dotbare bare will use fd instead of `find` when finding local files)
- [tree](https://linux.die.net/man/1/tree) (Will provide a directory tree view when finding directory)
```sh
# if you are on macos
brew install tree
```
### Setup
> Treat dotbare as normal `git` commands
> For interactive commands, check out [usage](#usage)
1. init git bare repository
```sh
dotbare finit
```
2. add dotfiles you want to track
```sh
dotbare fadd -f
# or
dotbare add [FIELNAME]
# add entire repository like .config
dotbare fadd -d
# or
dotbare add [DIRECTORY]
```
3. commit changes and push to remote
```sh
dotbare commit -m "First commit"
dotbare remote add origin [URL]
dotbare push -u origin master
```
### Migration
#### Migrating from normal git bare repository
1. follow the steps in [install](#Install) to install dotbare
2. check your current alias of git bare reference
```sh
# Below is an example alias, check yours for reference
alias config=/usr/bin/git --git-dir=$HOME/.cfg --work-tree=$HOME
```
3. set env variable for dotbare
```sh
export DOTBARE_DIR="$HOME/.cfg"
export DOTBARE_TREE="$HOME"
```
4. optionally you could alias config to dotbare so you keep your muscle memory
```sh
alias config=dotbare
```
#### Migrating dotbare to a new system
1. follow the steps in [install](#Install) to install dotbare
2. set env variable to let dotbare know where to init dotbare, backup etc.
> Copy below to your cmd line and set them temporarily
```sh
export DOTBARE_DIR="$HOME/.cfg"
export DOTBARE_TREE="$HOME"
```
3. give dotbare your remote URL and let it handle the rest