gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

Git authentication fails

Open bripkens opened this issue 1 year ago • 3 comments

Hey folks,

the git authentication is failing for me through the Gitbutler client. It is however working fine through the git CLI and various IDEs (Intellij and VSCode for example).

My setup:

  • GitHub auth via SSH keys
  • The SSH identity is stored in my OpenSSH auth agent (ssh-add -l)
  • The identity to use for GitHub is defined within my SSH config (cat ~/.ssh/config)

Within Gitbutler, I tried the Auto Detect mode, as well as Use existing SSH key (without passphrase).

Error shown within Gitbutler:

image

bripkens avatar Feb 11 '24 11:02 bripkens

This is happening for me as well, making Gitbutler functionally useless until this is fixed since I can't create pull requests from virtual branches.

I'm on a Mac M1 Pro, and have identical setup to the above.

I'm excited about gitbutler and will try it out again when this is fixed!

dchaniel avatar Feb 21 '24 18:02 dchaniel

Hey, sorry about the delay and about the issue you're running into. @bripkens do you use a git remote with an invalid host in order to specify the identity file? This is currently known to break the app, but we're keen to find a solution.

mtsgrd avatar Mar 02 '24 20:03 mtsgrd

Hey, sorry about the delay and about the issue you're running into. @bripkens do you use a git remote with an invalid host in order to specify the identity file? This is currently known to break the app, but we're keen to find a solution.

@mtsgrd To the best of my knowledge nothing is misconfigured/has an invalid host. For your info, here are excerpts of the files. And as mentioned, the config is working with all other solutions I am using (VSCode, Intellij and the git client itself):

$ cat ~/.ssh/config
Host github.com
  IdentityFile ~/.ssh/ed25519%
$ cat ~/.gitconfig
[credential]
  helper = osxkeychain
[url "[email protected]:"]
  insteadOf = https://github.com/
$ ssh-add -l
256 SHA256:Ro9{elided}s9yV5k [email protected] (ED25519)
$ git remote -v
origin  [email protected]:dash0hq/{elided}.git (fetch)
origin  [email protected]:dash0hq/{elided}.git (push)

^ Trailing % after ~/.ssh/config indicating missing trailing newline char in file.

bripkens avatar Mar 02 '24 21:03 bripkens

By now, there is a new option that allows to use the Git binary for fetch and push.

Screenshot 2024-04-22 at 15 54 01

Would you be able to try this and let us know if it works? Thank you.

Byron avatar Apr 22 '24 13:04 Byron

@Byron Pushing works 🎉. However, the commit becomes unverified.

image

bripkens avatar Apr 22 '24 16:04 bripkens

That's great to hear!

Regarding the signing issue, my assumption is that you have configured signing in Git, but GitButler commits are not necessarily respecting this configuration yet. However, it is able to sign commits itself using the generated SSH-Key, but it's a GitButler setting which might not be configured here.

Byron avatar Apr 23 '24 07:04 Byron

Regarding the unsigned commit, could you share your setup and roughly what you did to get that unsigned commit? (I think I have an idea, but want to be sure). From there, I'd be able to create a new issue and close this one. Thanks again for your help.

Byron avatar Apr 23 '24 07:04 Byron

Sure @Byron

Regarding the unsigned commit, could you share your setup and roughly what you did to get that unsigned commit?

From a UI perspective, I just went into Gitbutler and hit the commit button followed by push. I haven't configured any of Gitbutler's SSH keys/Gitbutler specific signing.

I would personally prefer to rely on Git's native signing capabilities and configuration.

The .gitconfig contains the usual. Also fyi, I can push without getting prompted for a GPG key passphrase (that is, if I have pushed once so far and the GPG session hasn't expired).

[user]
  name = Ben Blackmore
  email = [email protected]
  signingkey = 3C89A8D52B4321F6
[credential]
  helper = osxkeychain
[commit]
  gpgsign = true

bripkens avatar Apr 23 '24 07:04 bripkens

Thanks for the clarification and all the help!

I have created #3586 to capture this issue, and close this one as it appears resolved.

Byron avatar Apr 23 '24 09:04 Byron