* Issues With Trying To Use Magit Mode For GitHub Repos Via SSH Key
@ 2021-12-29 17:23 Samuel Banya
2022-01-03 0:25 ` Leo Butler
0 siblings, 1 reply; 4+ messages in thread
From: Samuel Banya @ 2021-12-29 17:23 UTC (permalink / raw)
To: Emanuel Berg
Hey there,
I'm trying to move all my personal Git repos back to GitHub.
I am having a difficult time doing so since I'm getting some weird side effects of either Git or Magit Mode acting weird.
Here's what I did:
- I made a single repo on my GitHub that's blank
- I then cloned the repo locally on my machine
- I then added the contents of the older repo (minus the '.git' directory) to the the cloned directory
- I then added all of the new folders and files to that particular repo via 'Magit' mode in Emacs
- I then attempted to push a commit to that new GitHub repo
- I was then prompted for a 'Username' and 'Password', which kept defaulting to using '@github.com' --> example: I would put 'Tom' --> it would change to 'tom@github.com' for the username. This even occurred even if I used the email I have for my GitHub account, 'tom@mail.com' --> 'tom@mail.com@github.com'
- I did some research and apparently GitHub changed their authentication methods to force either a Personal Access Token or through an SSH key
- So, I simply added my SSH key to my GitHub account, specifically the 'public' key (id_rsa.pub)
- However I'm getting the same weird results as above
I believe I have to modify the .git/config'* *file so that the 'url' is changed accordingly.
However, I'm a bit confused on actually WHAT to put in there.
Here's an example (not the actual line I used):
url = ssh://git@github.com:Tom/example.git
Also, I have this present in my ~/.ssh/config file as well:
Host github.com
IdentitiesOnly yes
IdentityFile ~/.ssh/id_rsa.pub
Any ideas on what I did wrong?
The only thing I can think of is that I made a blank GitHub repo to begin with, so my workflow is probably messed up as a result.
Any reference links would be cool too since I haven't used GitHub in ages in comparison so I have no idea how to approach this.
Just wanted to push my git repos to GitHub quickly.
Thanks,
Sam
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Issues With Trying To Use Magit Mode For GitHub Repos Via SSH Key
2021-12-29 17:23 Issues With Trying To Use Magit Mode For GitHub Repos Via SSH Key Samuel Banya
@ 2022-01-03 0:25 ` Leo Butler
2022-01-06 0:25 ` Samuel Banya
0 siblings, 1 reply; 4+ messages in thread
From: Leo Butler @ 2022-01-03 0:25 UTC (permalink / raw)
To: Samuel Banya; +Cc: Emanuel Berg
"Samuel Banya" <sbanya@fastmail.com> writes:
> ********************************************************
> Caution: This message was sent from outside the University of Manitoba.
> ********************************************************
>
> Hey there,
>
> I'm trying to move all my personal Git repos back to GitHub.
>
> I am having a difficult time doing so since I'm getting some weird
> side effects of either Git or Magit Mode acting weird.
>
> Here's what I did:
> - I made a single repo on my GitHub that's blank
> - I then cloned the repo locally on my machine
> - I then added the contents of the older repo (minus the '.git' directory) to the the cloned directory
> - I then added all of the new folders and files to that particular repo via 'Magit' mode in Emacs
> - I then attempted to push a commit to that new GitHub repo
> - I was then prompted for a 'Username' and 'Password', which kept
> defaulting to using '@github.com' --> example: I would put 'Tom' -->
> it would change to 'tom@github.com' for the username. This even
> occurred even if I used the email I have for my GitHub account,
> 'tom@mail.com' --> 'tom@mail.com@github.com'
> - I did some research and apparently GitHub changed their
> authentication methods to force either a Personal Access Token or
> through an SSH key
> - So, I simply added my SSH key to my GitHub account, specifically the 'public' key (id_rsa.pub)
> - However I'm getting the same weird results as above
>
> I believe I have to modify the .git/config'* *file so that the 'url' is changed accordingly.
>
> However, I'm a bit confused on actually WHAT to put in there.
>
> Here's an example (not the actual line I used):
> url = ssh://git@github.com:Tom/example.git
I don't think that url is right and that is causing your problem. My
config for a repo has
[remote "github"]
url = ssh://github.com/leo-butler/with_gensyms.git
fetch = +refs/heads/*:refs/remotes/github/*
>
> Also, I have this present in my ~/.ssh/config file as well:
> Host github.com
> IdentitiesOnly yes
> IdentityFile ~/.ssh/id_rsa.pub
>
> Any ideas on what I did wrong?
I would make a special github key, but that is not causing your problem.
Leo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Issues With Trying To Use Magit Mode For GitHub Repos Via SSH Key
2022-01-03 0:25 ` Leo Butler
@ 2022-01-06 0:25 ` Samuel Banya
2022-01-06 9:20 ` Robert Pluim
0 siblings, 1 reply; 4+ messages in thread
From: Samuel Banya @ 2022-01-06 0:25 UTC (permalink / raw)
To: Leo Butler; +Cc: Emanuel Berg
I tried this:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://github.com/SamuelBanya/SimpleSynth ssh://github.com/SamuelBanya/SimpleSynth.git
fetch = +refs/heads/*:refs/remotes/github/*
[branch "main"]
remote = origin
merge = refs/heads/main
Yet, when I use 'p' and 'u' in Magit Mode, I get this error:
128 git … push -v origin main\:refs/heads/main
Pushing to https://github.com/SamuelBanya/SimpleSynth ssh://github.com/SamuelBanya/SimpleSynth.git
fatal: unable to access 'https://github.com/SamuelBanya/SimpleSynth ssh://github.com/SamuelBanya/SimpleSynth.git/': URL using bad/illegal format or missing URL
Any ideas on what to do in that case?
Thanks!
Sam
On Sun, Jan 2, 2022, at 7:25 PM, Leo Butler wrote:
> "Samuel Banya" <sbanya@fastmail.com> writes:
>
> > ********************************************************
> > Caution: This message was sent from outside the University of Manitoba.
> > ********************************************************
> >
> > Hey there,
> >
> > I'm trying to move all my personal Git repos back to GitHub.
> >
> > I am having a difficult time doing so since I'm getting some weird
> > side effects of either Git or Magit Mode acting weird.
> >
> > Here's what I did:
> > - I made a single repo on my GitHub that's blank
> > - I then cloned the repo locally on my machine
> > - I then added the contents of the older repo (minus the '.git' directory) to the the cloned directory
> > - I then added all of the new folders and files to that particular repo via 'Magit' mode in Emacs
> > - I then attempted to push a commit to that new GitHub repo
> > - I was then prompted for a 'Username' and 'Password', which kept
> > defaulting to using '@github.com' --> example: I would put 'Tom' -->
> > it would change to 'tom@github.com' for the username. This even
> > occurred even if I used the email I have for my GitHub account,
> > 'tom@mail.com' --> 'tom@mail.com@github.com'
> > - I did some research and apparently GitHub changed their
> > authentication methods to force either a Personal Access Token or
> > through an SSH key
> > - So, I simply added my SSH key to my GitHub account, specifically the 'public' key (id_rsa.pub)
> > - However I'm getting the same weird results as above
> >
> > I believe I have to modify the .git/config'* *file so that the 'url' is changed accordingly.
> >
> > However, I'm a bit confused on actually WHAT to put in there.
> >
> > Here's an example (not the actual line I used):
> > url = ssh://git@github.com:Tom/example.git
>
> I don't think that url is right and that is causing your problem. My
> config for a repo has
>
> [remote "github"]
> url = ssh://github.com/leo-butler/with_gensyms.git
> fetch = +refs/heads/*:refs/remotes/github/*
>
>
> >
> > Also, I have this present in my ~/.ssh/config file as well:
> > Host github.com
> > IdentitiesOnly yes
> > IdentityFile ~/.ssh/id_rsa.pub
> >
> > Any ideas on what I did wrong?
>
> I would make a special github key, but that is not causing your problem.
>
> Leo
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Issues With Trying To Use Magit Mode For GitHub Repos Via SSH Key
2022-01-06 0:25 ` Samuel Banya
@ 2022-01-06 9:20 ` Robert Pluim
0 siblings, 0 replies; 4+ messages in thread
From: Robert Pluim @ 2022-01-06 9:20 UTC (permalink / raw)
To: Samuel Banya; +Cc: Emanuel Berg, Leo Butler
>>>>> On Wed, 05 Jan 2022 19:25:32 -0500, "Samuel Banya" <sbanya@fastmail.com> said:
Samuel> I tried this:
Samuel> [core]
Samuel> repositoryformatversion = 0
Samuel> filemode = true
Samuel> bare = false
Samuel> logallrefupdates = true
Samuel> [remote "origin"]
Samuel> url = https://github.com/SamuelBanya/SimpleSynth ssh://github.com/SamuelBanya/SimpleSynth.git
Samuel> fetch = +refs/heads/*:refs/remotes/github/*
Samuel> [branch "main"]
Samuel> remote = origin
Samuel> merge = refs/heads/main
Samuel> Yet, when I use 'p' and 'u' in Magit Mode, I get this error:
Samuel> 128 git … push -v origin main\:refs/heads/main
Samuel> Pushing to https://github.com/SamuelBanya/SimpleSynth ssh://github.com/SamuelBanya/SimpleSynth.git
Samuel> fatal: unable to access 'https://github.com/SamuelBanya/SimpleSynth
Samuel> ssh://github.com/SamuelBanya/SimpleSynth.git/': URL using bad/illegal
Samuel> format or missing URL
Samuel> Any ideas on what to do in that case?
You've specified two urls in the 'url' field. I suggest you stick to
just the 'ssh' one.
Robert
--
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-01-06 9:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-29 17:23 Issues With Trying To Use Magit Mode For GitHub Repos Via SSH Key Samuel Banya
2022-01-03 0:25 ` Leo Butler
2022-01-06 0:25 ` Samuel Banya
2022-01-06 9:20 ` Robert Pluim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).