Skip to content

Instantly share code, notes, and snippets.

@disouzam
Last active October 29, 2023 23:01
Show Gist options
  • Save disouzam/199e15f8b94f10c69c46cade8c9acb3e to your computer and use it in GitHub Desktop.
Save disouzam/199e15f8b94f10c69c46cade8c9acb3e to your computer and use it in GitHub Desktop.
Bash configuration
alias cls=clear
alias dangcom='git fsck --no-progress --no-reflogs | grep '\''dangling commit'\'''
# alias dangcom='gitk --all --date-order '$(git fsck --no-progress --no-reflogs | \grep 'dangling commit' | \gawk '{printf $3; printf " "}')''
alias uptag='git show-ref --tags -s -d | grep 'refs' > list-of-tags.txt'
@disouzam
Copy link
Author

These are the first alias that I'm creating for regular use in bash.

@disouzam
Copy link
Author

Typing alias in bash list all configured alias in .bashrc

@disouzam
Copy link
Author

disouzam commented Oct 22, 2023

Added a new alias to open gitk with dangling commits

alias dangcom='gitk --all --date-order '$(git fsck --no-progress --no-reflogs | \grep 'dangling commit' | \gawk '{printf $3; printf " "}')''

References:

With adaptation coming from:

@disouzam
Copy link
Author

The drawback of this alias is that it gets expanded on shell starts - so, if a new dangling commit was created after the shell started, a new shell must be opened to get the full list of dangling commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment