This repository contains a collection of useful shell aliases:
- e – exporting environment variables from
.env
files - clone – clone Git repository into
~/Projects/<owner>/<repo>
directory - new – create new Go project with
gonew
tool - pull – Git pull with stash & rebase
e
is a small shell alias for exporting environment variables from .env
files.
You can find more alternative solutions here: https://gist.github.com/mihow/9c7f559807069a03e302605691f8557
Usage example:
$ cat .env
KEY=VALUE
$ echo $KEY
$ e
$ echo $KEY
VALUE
Accepts one optional argument – filename:
e .env.prod
Installation:
Bash:
source e.sh
# to persist append content of e.sh to ~/.bash_profile
Fish:
source e.fish
# to persist copy e.fish to ~/.config/fish/functions/
clone is a wrapper on top of the git clone
command, it:
- parses the URL
- creates "owner" directory in
~/Projects/
- clones repository into
~/Projects/<owner>/<repo>
Works with both SSH and HTTPS URLs.
Usage example:
$ cd ~/ # run from anywhere
$ clone git@github.com:chuhlomin/terraform.git
Cloning into '/Users/username/Projects/chuhlomin/terraform'...
Installation:
chmod +x clone.sh
mv clone.sh /usr/local/bin/clone
new <template> <new go module>
is an alias for gonew
:
gonew github.com/chuhlomin/gonew/<template> github.com/<current_directory>/<new go module>
Usage example:
$ cd ~/Projects/username
$ new server project
gonew: initialized github.com/username/project in ./project
Installation:
chmod +x new.sh
mv new.sh /usr/local/bin/new
pull
is a wrapper on to git pull
with stash & rebase.