Hacker News new | ask | show | jobs
by wtetzner 19 days ago
TBH I usually just search my shell history for the last time I added a remote and edit it.
1 comments

It's also not particularly hard to write a shell function to avoid needing to care about the syntax, e.g.:

    add_github_remote() {
        git remote add $1 git@github.com:$2/$3.git
    }
Better yet, assign the positional arguments to named variables for documentation purposes; you can see them when you `type` the function. (Comments get stripped, unless you make an actual script.)
thats just the same problem though, ig you arent using it regularly you are going to forget that part of your shell functions
1. Develop the instinct of "I probably have a shell function for that, if it isn't already obvious; and if I don't, I need to fix that"

2. Give your shell functions a common prefix, and/or big-endian naming convention (e.g. things that help you with git start with `@git-`)

3. Tab completion is your friend.

I wholeheartedly agree that it's the same, but I fundamentally disagree about it being a "problem", or at least, one worth caring about. I don't honestly believe that typing out the extra 35 characters that are filled in by the helper function I gave here would solve anything that comes close to the convenience of not needing to memorize them.