add new command to easily rename a git-repository#1404
Conversation
notheotherben
left a comment
There was a problem hiding this comment.
This looks like a really neat addition - up until now I've generally done a mv <repo> && cd <repo> && gt fix but this is much cleaner and (especially if we integrate it with the GitHub API) would save me a lot of time organizing things.
One major downside: it's going to contribute to naming indecision and result in me changing repo names far more regularly 😂 (a nice problem to have).
| fn app(&self) -> clap::Command { | ||
| clap::Command::new(self.name()) | ||
| .about("renames a repository on your local machine") | ||
| .long_about("This command will rename the specified repository on your local machine. It requires that the repository name be provided in fully-qualified form.") |
There was a problem hiding this comment.
(Optional) I think it would be really cool to have this command tie into the online::service::github stuff to enable renaming of GitHub repositories automatically.
That'd likely need a new task::RenameRemote to mirror the existing task::CreateRemote and we probably want to add a config flag + a command line argument to control the behaviour if we do so.
If we did build that, I suspect we'd need to be pretty clever as well about determining a few things:
- Are both repos part of the same service?
- Are both repos part of the same namespace? (If so, rename the repo)
- Are both repos part of different namespaces? (If so, transfer the repo)
The cool part is that if we built that on the existing online::services::* machinery, it would be pretty straightforward to extend it to support other services in future - and it'll automatically support GitHub Enterprise too.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1404 +/- ##
==========================================
+ Coverage 84.59% 84.94% +0.34%
==========================================
Files 93 96 +3
Lines 9497 10136 +639
==========================================
+ Hits 8034 8610 +576
- Misses 1463 1526 +63
🚀 New features to boost your workflow:
|
744860d to
2064ca0
Compare
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://brave-meadow-00ba9e303-1404.westeurope.1.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://brave-meadow-00ba9e303-1404.westeurope.1.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://brave-meadow-00ba9e303-1404.westeurope.1.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://brave-meadow-00ba9e303-1404.westeurope.1.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://brave-meadow-00ba9e303-1404.westeurope.1.azurestaticapps.net |
this PR adds the functionality to rename git repositories and automatically change the upstream URL.
For example, given a repository layout of
running
will result in
However, if you wish to only update the repository locally, you can specify
--no-update-remote:will result in
leaving the
originURL in tact