Last active
October 29, 2023 23:01
-
-
Save disouzam/199e15f8b94f10c69c46cade8c9acb3e to your computer and use it in GitHub Desktop.
Bash configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
Typing alias in bash list all configured alias in .bashrc
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:
- https://sethrobertson.github.io/GitBestPractices/ (adapted the original alias from this blog post)
With adaptation coming from:
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
These are the first alias that I'm creating for regular use in bash.