Bash aliases and helper scripts
. <(curl -L https://j.mp/_rc) runsascoded/.rc
This downloads clone-and-source.sh
and runs it on this repo/branch, cloning into .rc/
, appending to .bashrc
(to source
.rc
in new sessions), and source
ing .rc
in the current session.
This branch (server) is default; all includes a few additional modules:
submodules() {
git ls-tree "$@" | grep commit | awk '{print $4}'
}
comm -3 <(submodules server) <(submodules all)
# hammerspoon
# osx
# ruby
This repo and its submodules are also mirrored on GitLab.
A few submodules require additional setup steps (but can be ignored if unused):
- java → jenv
- js → nvm
- parallel → GNU Parallel
- python: doesn't install Python, but provides
install_pyenv
andinstall_conda
helpers.
I typically set these global configs as well:
# Link global Git config file to ~/git/config
mkdir -p git
touch git/config
ln -s git/config ~/.gitconfig
touch git/ignore
rs # Reload shell
# Set default Git configs
git config --global init.defaultBranch main # a.k.a. `gdbm`
git config --global clone.defaultRemoteName u # a.k.a. `gcdr u`
git config --global push.default current # a.k.a. `gpdc`
git config --global receive.denyCurrentBranch ignore # a.k.a. `gaps`
git config --global diff.noprefix true # a.k.a. `gdnpt`
git config --global diff.submodule log # a.k.a. `gcdsl`
(aliases above are defined in git-helpers)
Additionally, here's how I configure some common global .gitignore
patterns:
# a.k.a. `gggi ...`
git global-gitignore \
"*.egg-info" \
".ipynb_checkpoints" \
"__pycache__" \
".jupyter" \
".python-version" \
"*.iml" \
".idea" \
"node_modules" \
".vite"
git/.git-rc
automatically adds several configuration paths, if they exist:
core.excludesfile
:~/git/ignore
,~/global.gitignore
core.attributesfile
:~/git/attributes
,~/.gitattributes