cli/pkg/cmd
Tim Rogers c719d920c3
When renaming an existing remote in gh repo fork, log the change
When running `gh repo fork` in the context of an existing repo, the CLI offers to create a remote for the fork:

```
? Would you like to add a remote for the fork? Yes
```

If you accept, it prints a log stating that the `origin` remote has been created:

```
✓ Added remote origin
```

Where there is an existing `origin` remote, this is renamed to `upstream`, but this is done silently without any notification to the user.

```bash
$ git remote -v
origin	https://github.com/timrogers/badger.github.io.git (fetch)
origin	https://github.com/timrogers/badger.github.io.git (push)
upstream	https://github.com/badger/badger.github.io.git (fetch)
upstream	https://github.com/badger/badger.github.io.git (push)
```

It seems kinda fine to rename the remote without explicitly confirming since this is not a truly destructive action, but it should make it clear what it is doing.

This updates the logging to explicitly log about the renaming of
the existing remote:

```
✓ Renamed remote origin to upstream
```

Fixes #9982.
2024-11-30 21:19:55 +00:00
..
actions Additional formatting changes 2023-12-01 09:08:51 -05:00
alias Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
api Update documentation for gh api PATCH 2024-07-22 19:36:20 +01:00
attestation pr feedback 2024-11-21 15:40:15 -07:00
auth Fix ssh directory 2024-11-06 16:13:29 +00:00
browse Update pkg/cmd/browse/browse.go 2024-01-05 10:53:15 -04:00
cache Apply suggestions from code review 2024-11-21 13:55:35 -07:00
codespace Refactor command documentation to use heredoc 2024-11-21 13:23:03 -07:00
completion Bump github.com/spf13/cobra from v1.4.0 to v1.5.0 (#6196) 2022-09-06 09:43:40 +04:00
config Add prefer_editor_prompt config 2024-07-09 21:01:50 +09:00
extension Check extOwner for no value instead 2024-10-21 13:28:37 -06:00
factory Fix repo fork to use remote protocol if none configured 2024-05-10 10:48:36 +02:00
gist Merge pull request #9728 from heaths/issue9704 2024-10-15 16:26:13 -07:00
gpg-key Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
issue Allow client fetch to use insecure credentials pattern 2024-11-26 22:30:03 +01:00
label Fix tests 2024-08-16 10:11:52 -07:00
org Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
pr Add checkout test that uses ssh git remote url 2024-11-27 13:06:35 +01:00
project Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
release Refactor error handling for missing "workflow" scope in createRelease 2024-11-23 16:59:49 -07:00
repo When renaming an existing remote in gh repo fork, log the change 2024-11-30 21:19:55 +00:00
root Shorten extension release checking from 3s to 1s 2024-11-13 13:04:01 -05:00
ruleset Use go-gh/auth package for IsEnterprise, IsTenancy, and NormalizeHostname 2024-10-15 11:56:43 -07:00
run Fix verbiage for deleting workflow runs 2024-11-04 17:55:35 +02:00
search Resolve PR feedback 2024-10-14 15:08:23 -07:00
secret Fix host handling in variable and secret delete 2024-08-02 15:11:22 -04:00
ssh-key Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
status Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
variable Merge branch 'trunk' into tab-indents 2024-08-06 13:08:48 -04:00
version Fix --version flag printing to stdout 2022-05-24 16:21:13 +02:00
workflow Fix tests 2024-08-16 10:11:52 -07:00