bashtidy
The container's bash shell is set up with bashtidy, a lightweight bash configuration: a git-aware prompt, short git aliases, colors, and a small tool for persistent environment variables. It is loaded in every shell; there is nothing to enable.
Prompt
Inside a git repository the prompt shows the path and branch; outside, only the path:
[~/projects/app :: master] ➜ # clean
[~/projects/app :: dev*] ➜ # dev branch with changes
[~/projects/app :: feature-auth+] ➜ # untracked files
[~/projects/app] ➜ # not a git repositoryThe branch name is colored by type:
| Branch | Color |
|---|---|
main / master | green |
dev | yellow |
feature-* | blue |
| anything else | orange |
Status markers after the branch name (shown in yellow):
| Marker | Meaning |
|---|---|
* | Modified, added or deleted files |
+ | Untracked files |
! | Merge conflict |
Git aliases
| Alias | Command |
|---|---|
g | git |
gi | git init |
gcl | git clone |
gst | git status |
gss | git status -s |
gl | git log --oneline --graph --decorate --all |
glo | git log --oneline -20 |
gd | git diff |
gds | git diff --staged |
gb | git branch |
gba | git branch -a |
gbd | git branch -d |
gbD | git branch -D |
gco | git checkout |
gcob | git checkout -b |
gsw | git switch |
gswc | git switch -c |
ga | git add |
gaa | git add -A |
gap | git add -p |
gc | git commit |
gcm | git commit -m |
gca | git commit --amend |
gcane | git commit --amend --no-edit |
gsh | git stash |
gshl | git stash list |
gshp | git stash pop |
gshd | git stash drop |
gf | git fetch |
gfa | git fetch --all |
gpl | git pull |
gplr | git pull --rebase |
gps | git push |
gpsu | git push -u origin HEAD |
gpsf | git push --force-with-lease |
gm | git merge |
grb | git rebase |
grbi | git rebase -i |
grbc | git rebase --continue |
grba | git rebase --abort |
grh | git reset HEAD |
grhh | git reset --hard HEAD |
gclean | git clean -fd |
gt | git tag |
gtl | git tag -l |
gwip | Stage everything and commit as "WIP" |
gunwip | Undo the last commit |
envhub: persistent environment variables
envhub saves environment variables so that every new shell loads them. Changes also apply to the current shell right away.
| Command | Purpose |
|---|---|
envhub set KEY VALUE | Save a variable and export it now |
envhub set KEY | Same, but prompt for the value (hidden, not saved in history) |
envhub unset KEY | Remove a variable and unset it now |
envhub list | Show saved variables |
envhub edit | Edit the file with $EDITOR, then reload |
bash
envhub set PROXY "http://127.0.0.1:7890"
envhub set OPENAI_API_KEY # prompts; nothing is echoed or recorded
envhub list- Variables are stored in
~/.config/envhub, readable only by you (mode600). - A value given on the command line ends up in shell history. For secrets, use
envhub set KEYwithout a value. - Shells that are already open keep their old values until you open a new shell or run
source ~/.bashrc. - Like everything outside
/workspace, the saved variables are lost when the container is removed. See Data & Persistence.
Other conveniences
ls,ll,la,lwith colorsgrep,fgrep,egrep,diffwith colors..,...,....to go up one, two or three directories;-to go back to the previous directory- Shell history with timestamps and without duplicates