Define an alias to simplify Git commands for managing your dotfiles:
```sh
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
```
### 3. Checkout the Repository
Checkout the actual content from the repository to your home directory:
```sh
dotfiles checkout
```
If you encounter errors because some files already exist, back them up or remove them before retrying the checkout command.
### 4. Configure Git to Ignore Untracked Files
Configure the repository to not show untracked files to keep your home directory clean:
```sh
dotfiles config --local status.showUntrackedFiles no
```
## Usage
With the alias defined, you can now manage your dotfiles using standard Git commands prefixed with `dotfiles`.
### Examples:
- Add a file:
```sh
dotfiles add .vimrc
```
- Commit changes:
```sh
dotfiles commit -m "Add vim configuration"
```
- Push changes:
```sh
dotfiles push
```
- Pull changes:
```sh
dotfiles pull
```
## Customization
You can customize this setup to include additional files or directories by adding them to the repository and committing the changes.
## Backup and Restore
To backup your dotfiles, simply push your changes to the remote repository. To restore them on a new machine, follow the cloning and checkout steps above.