Create an alias in your shell so you don't have to retype the whole command all the time:
# Nushell
def --wrapped dotfiles [...args: string] {
let git_dir = $env.HOME | path join ".dotfiles"
(
/usr/bin/git
$"--git-dir=($git_dir)"
$"--work-tree=($env.HOME)"
...$args
)
}# (ba|z)sh
alias dotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"'# Nushell
echo ".dotfiles" | save .gitignore --append# (ba|z)sh
echo ".dotfiles" >> .gitignoreFirst, backup any already existing configuration files, e.g.
mv ~/.zshrc ~/.zshrc.bak.
# Nushell
let dotfiles_dir = $env.home | path join ".dotfiles"
git clone --bare <git-repo-url> $dotfiles_dir# (ba|z)sh
git clone --bare <git-repo-url> $HOME/.dotfilesdotfiles checkout
dotfiles config --local status.showUntrackedFiles no