-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename repository #390
Comments
Yeah, a 2-step process including web + command-line sucks. It would be great to encapsulate this, but I'm wary of adding new commands with generic-sounding names. I don't want to clash with somebody's custom commands or aliases. I'm also not sure about the usefulness of the command. Sure, it's nice to have that one time when you rename a repo, but maybe my time implementing it and maintaining it will be greater than the total time I save for people in their workflows. It just doesn't happen that often. I need to think about this idea, so I'll leave this open. |
My strategy for the set of plugins I've started collecting has been to make longer, more descriptive names for each command, then encourage users to create their own more convenient aliases. In this case, could be something like |
Fix recognition logic for vi editor variants again Fixes mislav#390.
After some consideration, I have decided that—for now—this is best implemented in user scripts, rather than maintained in hub core. Now that there is a new For example: hub api -XPATCH repos/{owner}/{repo} -f name=my-new-name
# (parse out the new URL from server response)
git remote set-url origin <NEW-URL> Thank you for suggesting! |
or with an alias [alias]
set-url = remote set-url origin
rename-repo = "!f() { hub api --flat -XPATCH repos/{owner}/{repo} -f name=$1 | grep .ssh_url | awk '/.ssh_url/ {print $2}' | xargs git set-url; }; f" so that you run P.S. thank you to @mislav and GitHub for |
A slight modification to @gko's alias to rename the current directory to match the repo name:
|
Putting this in my |
When I'm working on a new project, I find myself renaming it after I realize what it's really about. This is a multi-step manual process:
git remote set-url origin ...
Would be great to have this as a one-liner (with a confirmation) using hub. My proposal:
The text was updated successfully, but these errors were encountered: