Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git push failed fatal: could not read Username for 'https://github.com': No such device or address #17

Open
dodo-the-dev opened this issue Sep 1, 2022 · 11 comments

Comments

@dodo-the-dev
Copy link

I seem to be able to pull from the repo my logseq file is in no problems, but it won't let me push to it coming up with the following error:

Git push failed
fatal: could not read Username for 'https://github.com': No such device or address

I've looked everywhere I can, but I can't find where to update the credentials (if there is such a place). I apologise if I'm being dumb.

@umrwifi
Copy link

umrwifi commented Sep 16, 2022

me to

@zhaobenx
Copy link

same

@zhaobenx
Copy link

hi guys, I found a way to solve this issue. You need to generate a github token and change your upstream settings. Follow the link on how to do this:
https://stackoverflow.com/a/68779977/8550989

@negue
Copy link

negue commented Oct 13, 2022

I didn't wanted the token in the remote url and after many fails I got it to work with this:

  1. open the terminal
  2. go to /Applications/Logseq.app/Contents/Resources/app/node_modules/dugite/git/libexec/git-core
  3. execute sudo ln -s /usr/local/git/bin/git-credential-osxkeychain ./git-credential-osxkeychain

This links the "normal" osxkeychain binary to the dugite/git/libexec folder which seems to have most of the git binaries linked? and with that it works

I don't have any idea if this could be added to the dugite node package itself - or if logseq has to add it or even if its possible to do in this plugin - don't have enough logseq experience yet xD

@samueljklee
Copy link

If you were using HTTPS for your git config url, change it to SSH link. that resolves this issue for me.
I'm on MacOS.

CleanShot 2022-12-22 at 16 20 36@2x

@Bibabidu
Copy link

I'm on Linux using git-credential-libsecret and due to the way my Gitea is setup, I cannot use SSH but rather rely on HTTPS. Is there a way I can fix the issue anyway?

@aaronlonwilliams
Copy link

The information above was helpful but had to do some trial and error to finally get it right. Here are the steps that got it working.

  • Change the remote URL to use SSH token. How to change git remote URL:
    • Go here to generate a token: https://github.com/settings/tokens
    • Add repo scopes and generate the token, save the token in a secure place.
    • Open terminal in the Logseq graph folder
    • View current remotes:
      git remote -v
    • Change remote URL:
      git remote set-url origin https://[token]@github.com/[username]/[repo_name].git

@akinxwumi
Copy link

akinxwumi commented Apr 7, 2023

The information above was helpful but had to do some trial and error to finally get it right. Here are the steps that got it working.

  • Change the remote URL to use SSH token. How to change git remote URL:

    • Go here to generate a token: https://github.com/settings/tokens
    • Add repo scopes and generate the token, save the token in a secure place.
    • Open terminal in the Logseq graph folder
    • View current remotes:
      git remote -v
    • Change remote URL:
      git remote set-url origin https://[token]@github.com/[username]/[repo_name].git

Thanks a lot 🙏🏾. This saved me a whole lot of headache.

@hvddrift
Copy link

I'm on Linux using git-credential-libsecret and due to the way my Gitea is setup, I cannot use SSH but rather rely on HTTPS. Is there a way I can fix the issue anyway?

I am in the same situation as you. Did you find a solution?

@peterhajas
Copy link

Some research I did into this issue based off of @negue's suggestion (I am a self-hosted gitea user with an https URL):

  • The git at /Applications/Logseq.app/Contents/Resources/app/node_modules/dugite/git/libexec/git-core/git can't push:
$ /Applications/Logseq.app/Contents/Resources/app/node_modules/dugite/git/libexec/git-core/git push
git: 'remote-https' is not a git command. See 'git --help'.
  • With some searching, that seems to mean that the git was not compiled with libcurl support.
  • After replacing this with my system's git, still no luck. I'm able to push:
$ which git
/opt/homebrew/bin/git
$ rm /Applications/Logseq.app/Contents/Resources/app/node_modules/dugite/git/libexec/git-core/git
$ sudo ln -s /opt/homebrew/bin/git /Applications/Logseq.app/Contents/Resources/app/node_modules/dugite/git/libexec/git-core/git
$ /Applications/Logseq.app/Contents/Resources/app/node_modules/dugite/git/libexec/git-core/git push
Enumerating objects...

but the plugin can't. Bummer! I'm not sure if there is a way to proceed here without manually pushing. Committing with the plugin works great.

@davidefornelli
Copy link

Thank you for the guide!
I slightly changed it to use it with an SSH URL:

...

  • Open terminal in the Logseq graph folder
  • View current remotes:
    git remote -v
  • Change remote URL:
    git remote set-url origin [email protected]:[username]/[reponame].git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests