holzschu / a-shell

A terminal for iOS, with multiple windows
BSD 3-Clause "New" or "Revised" License
2.67k stars 116 forks source link

Can't push new repos to github using ssh with key or https with password #716

Closed Iridium-Lo closed 11 months ago

Iridium-Lo commented 11 months ago

a-shell is the best terminal out there on phones. I can't be bothered sitting on my laptop at times.

Can you tell me how I can push a new repo to git?

I've done my usual workflow of:

λ git init .
Initialized empty Git repository in /private/var/mobile/Containers/Data/Application/2F2067
1C-AAB3-4DA3-A2BD-209917AE247A/Documents/git/
λ git remote add origin git@cat:/Iridium-lo/a
Shell 
λ git add .
λ git commit -m 'x'
HEAD not found. Creating the first commit.
Error creating signature.
This seems to be a configuration error, proba
bly the result of missing or invalid author i
nformation.
Try running 
    lg2 config user.name 'Your Name'
    lg2 config user.email youremail@example.c
om
to provide authorship information for new com
mits in this repository.
This information is used to label new commits
 and will travel with them (e.g. it's shared 
with servers when you `lg2 push`).
Bad news:
 config value 'user.name' was not found
λ git config user.name Iridium-lo
λ git config user.kayocerasso@gmail.com  
λ git push -u origin master
Error pushing [-1] - failed to resolve address for cat: nodename nor servname provided, or not known

git config

λ cat .git/config 
[core]
        bare = false
        repositoryformatversion = 0
        filemode = true
        precomposeunicode = true
        logallrefupdates = true
[remote "origin"]
        url = git@cat:/Iridium-lo/aShell
        fetch = +refs/heads/*:refs/remotes/or
igin/*
[user]
        name = Iridium-lo

ssh config

λ cat .ssh/config 
host cat
  user git
  hostname github.com
  identityFile ~/Documents/.ssh/lynx

I have my lynx key on github.

If I try to push using HTTPS it doesn't accept my password. If you try it, your bound to run in to the same errors.

holzschu commented 11 months ago

I'm not in a position to run tests right now, but from reading the error message, it seems that lg2 is only reading .git/config but not .ssh/config (which, IIRC, is indeed a limitation of lg2 compared to git). You will have to transfer the information into the .git/config file:

[core]
        bare = false
        repositoryformatversion = 0
        filemode = true
        precomposeunicode = true
        logallrefupdates = true
[remote "origin"]
        url = git@github.com:/Iridium-lo/aShell
        fetch = +refs/heads/*:refs/remotes/or
igin/*
[user]
        name = Iridium-lo
        identityFile ~/Documents/.ssh/lynx

That should do it (again, I cannot run tests, so you may have to fix a few issues to make it work, but you get the idea).

Iridium-Lo commented 11 months ago

thank you

Iridium-Lo commented 11 months ago

thanks