cmoulliard (12) [Avatar] Offline
#1
Hi Mike,

I have a problem with Technique 60 - step 2. If I run the 'gh fork' under my git repo I get this error message :

"GitInPracticeRedux # gh fork
Updating ch007m@gmail.com
fatal: remote error:
ch007m@gmail.com/GitInPracticeRedux is not a valid repository name
Email support@github.com for help"

This info is added to the .git/config file

"[remote "ch007m@gmail.com"]
url = git@github.com:ch007m@gmail.com/GitInPracticeRedux.git
fetch = +refs/heads/*:refs/remotes/ch007m@gmail.com/*"

So to fork the git repo, the "gh" command is using the email address and not the user name. This is really strange as my user name is defined under the .git/config file ?
For this exercise, you suggest to do a fork within a local repo. Normally a fork is done from an "external" git repo to a local git repo. Do I miss something here ?

Regards,

Charles
Mike McQuaid (83) [Avatar] Offline
#2
Re: issue with gh fork - Technique 60
> I have a problem with Technique 60 - step 2. If I run
> the 'gh fork' under my git repo I get this error
> message :
>
> "GitInPracticeRedux # gh fork
> Updating ch007m@gmail.com
> fatal: remote error:
> ch007m@gmail.com/GitInPracticeRedux is not a valid
> repository name
> Email support@github.com for help"
>
> This info is added to the .git/config file
>
> "[remote "ch007m@gmail.com"]
> url =
> git@github.com:ch007m@gmail.com/GitInPracticeRedux.git
>
> fetch =
> +refs/heads/*:refs/remotes/ch007m@gmail.com/*"
>
> So to fork the git repo, the "gh" command is using
> the email address and not the user name. This is
> really strange as my user name is defined under the
> .git/config file ?

Try to delete the ~/.config/gh file and rerun gh and ensure you enter your username and not email when it prompts. Let me know if that doesn't work.

> For this exercise, you suggest to do a fork within a
> local repo. Normally a fork is done from an
> "external" git repo to a local git repo. Do I miss
> something here ?

In this case we're forking from a local clone of a remote Git repository. This just provides gh with a bit more metadata but the existing local clone is not required.