Notes
This is a collection of tiny scripts that you can execute through the terminal.
These are designed for Ubuntu (with zsh), but may...
For further actions, you may consider blocking this person and/or reporting abuse
A few thoughts -
1 might be better named "git-uncommit" because "undo" implies reverting whatever the last action was, not specifically the last commit.
2, 3 and 4 don't need a shebang. They need to be
source
d rather than executed else they'll do nothing.4 doesn't need the
function
keyword, and has two commands on the same line separated with a semicolon which is not great for readability.6 and 7 would be better off using
$()
than backticks.8 and 9 mix a lot of styles and seems like they could be made more readable by sticking to
printf
instead ofecho
and consistently using double-quotes.8 and 9 rely on the main branch being called "master" which is less and less likely to be the case nowadays. If you're using git-flow, you can use this hack to get the name of the "master" branch:
They also expect certain conventions for other branches such as "unstable" and the principle remote to be called "origin", which is not always the case.
Thanks Fellow Ben,
Cheers for the feedback, you seem to have some knowledge of shell code, do you have your own library of snippets too? If not you should consider starting a dotfiles git repo 👍
Cheers
I have one! And it has a few git tools in it.
I had the same alias as you for "undo" but as a git alias and just updated it to be "uncommit" rather than my rather dumb, "oops" command. I never used "oops" for exactly the reason I put in my comment. I remembered I had it but not what it did and couldn't be bothered to check. Now maybe I will...
github.com/moopet/dotfiles
Thanks for sharing, yeah personally I like to name functions as an extension of the original command e.g;
git-uncommit
is longer but it's easily discoverable when you're typing git and tab-completion makes it fairly easy to type.I like your alias
alias gti='git'
I always mistype that!love this! I'm on OS X and added the
github-open
command - i just had to change the last line toopen #{repolink}
Also, it took me a minute to figure out that I needed to add these files to my $PATH, a note in the post on how to do this would be helpful for others!
Nice tips!
I've some useful things on my dotfiles: github.com/helderburato/dotfiles
Nice, thanks for sharing. I like the functions you have here:
github.com/helderburato/dotfiles/b...
Especially the find function, looks much simpler 👌
You're welcome :D
Someone should make them into an npm package
See the beauty of making your own scripts (dotfiles) is that you maintain them yourself! Don't have to worry about breaking changes, fixing other peoples issues, it's great!
Yh, It is
that list is 🔥
If you're into this stuff checkout my projects mkws.sh and adi.tilde.institute. Some are WIP. Feedback is welcomed!