Skip to content

Instantly share code, notes, and snippets.

@mwilsoncoding
Last active July 2, 2020 14:23
Show Gist options
  • Save mwilsoncoding/f385364ceab7b9f2224faafdb1dc2ccf to your computer and use it in GitHub Desktop.
Save mwilsoncoding/f385364ceab7b9f2224faafdb1dc2ccf to your computer and use it in GitHub Desktop.
Version Control Aliases in 2020
# Git only
alias gi='git init -q; fle=$(mktemp -p .); git add .; git commit -am init &>/dev/null; rm $fle; git branch -m main; git commit -am main &>/dev/null; unset $fle;'
# Pijul only
alias pi='pijul init; pijul fork main; pijul prune master;'
# Git and Pijul
alias gi='git init -q; ! [ -d ./.pijul ] || { echo ".pijul/" >>.gitignore; echo ".git/" >>.pijulignore; git add .; git commit -am ".gitignore and .pijulignore" &>/dev/null; pijul add --recursive .; pijul record -am ".gitignore and .pijulignore" &>/dev/null; }; fle=$(mktemp -p .); git add .; git commit -am init &>/dev/null; rm $fle; git branch -m main; git commit -am main &>/dev/null; unset $fle;'
alias pi='pijul init; pijul fork main; pijul prune master; ! [ -d ./.git ] || { echo ".pijul/" >>.gitignore; echo ".git/" >>.pijulignore; git add .; git commit -am ".gitignore and .pijulignore" &>/dev/null; pijul add --recursive .; pijul record -am ".gitignore and .pijulignore" &>/dev/null; };'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment