Sublime Forum

Cannot Push to Remote

#1

Pushing works fine from iTerm. Does not work from Merge. This is an existing repository I’ve been working with for a while. Do I need to manually add my SSH key path to Merge?

ssh -v git@github.com greets me with the success message “Hi tyleretters! You’ve successfully authenticated, but GitHub does not provide shell access.”

0 Likes

#2

Try running ssh-add -K and then re-opening merge and see if it works

0 Likes

#3

ssh-add -K returns an error.

0 Likes

#4

Can you try it with the path to your key?

ssh-add -K ~/.ssh/KEYPATH

0 Likes

#5

Same result. Still cannot push from Merge. I confirmed this is the key being used on GitHub.

0 Likes

#6

This is very odd, it should be picking up your normal setup from your env.

@djohnston @wbond Either of you have any ideas of next steps?

0 Likes

#7

Does running git push work from the command line?

0 Likes

#8

Yes. Here’s a screencap: https://www.loom.com/share/bcc31988b9f14956bb177735cfebc29e

(Edit: I originally said “No.” :sweat_smile:)

0 Likes

#9

@bschaaf @TheSecEng any more troubleshooting I can try?

0 Likes

#10

Posting the debug information may help. You can get it from the menu Help > Debug Information.

0 Likes

#11

I tried to push again before grabbing this:

=== App Version Information ===
Build: 2020

=== Git Version Information ===
Using Git: git (system)
git version 2.21.0 (Apple Git-122)
PATH: /Users/mbp/.rvm/gems/ruby-2.6.3/bin:/Users/mbp/.rvm/gems/ruby-2.6.3@global/bin:/Users/mbp/.rvm/rubies/ruby-2.6.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/mbp/.rvm/bin (from shell)
environment variables loaded using: /bin/zsh -l

=== Browse Page Information ===
HEAD: 3f1d46aba296579753cb4e2f331d3e7ae97bb5bb
Is in merge: 0
Is in cherry_pick: 0
Is in rebase: 0
Is in revert: 0

=== Git Status Information ===

=== Our Status Information ===

=== Git Config Information ===
branch.master.merge=refs/heads/master
branch.master.remote=origin
core.bare=false
core.filemode=true
core.ignorecase=true
core.logallrefupdates=true
core.precomposeunicode=true
core.repositoryformatversion=0
credential.helper=osxkeychain
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=git@github.com:tyleretters/arcologies.git
user.email=tyler@etters.co
user.name=Tyler Etters

=== Our Config Information ===
Git Config Path Information
Using config path: /etc/gitconfig
Using config path: /Users/mbp/.config/git/config
Using config path: /Users/mbp/.gitconfig
Using config path: /Users/mbp/projects/arcologies/.git/config

Our config output is different to the Git config output
branch.master.merge=refs/heads/master
branch.master.remote=origin
core.bare=false
core.filemode=true
core.ignorecase=true
core.logallrefupdates=true
core.precomposeunicode=true
core.repositoryformatversion=0
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=git@github.com:tyleretters/arcologies.git
user.email=tyler@etters.co
user.name=Tyler Etters

=== Git Attributes Information ===
git check_attr --all output

=== Our Modified Files Newline Normalisation and EOL Information ===
0 Likes

#12

Hi @tyleretters,

Could you try closing Sublime Merge, then opening Sublime Merge via the terminal.
Once this is done, let me know if the issue is still persisting.

Thanks,
- Dylan

0 Likes

#13

Thank you, Dylan. We’re getting somewhere. I can only push or pull when I open it from the terminal. I cannot push or pull otherwise. Here’s some more debug ifno.

  === App Version Information ===
Build: 2020

=== Git Version Information ===
Using Git: git (system)
git version 2.21.0 (Apple Git-122)
PATH: /Users/mbp/.rvm/gems/ruby-2.6.3/bin:/Users/mbp/.rvm/gems/ruby-2.6.3@global/bin:/Users/mbp/.rvm/rubies/ruby-2.6.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/mbp/.rvm/bin (from shell)
environment variables loaded using: /bin/zsh -l

=== Browse Page Information ===
HEAD: 68d8bcc3b0aba6afc4f4f4288a572ffcfb860a04
Is in merge: 0
Is in cherry_pick: 0
Is in rebase: 0
Is in revert: 0

=== Git Status Information ===
?? collections/_posts/2020-06-09-lines-community-stream.md

=== Our Status Information ===
?? collections/_posts/2020-06-09-lines-community-stream.md

=== Git Config Information ===
branch.master.merge=refs/heads/master
branch.master.remote=origin
core.bare=false
core.filemode=true
core.ignorecase=true
core.logallrefupdates=true
core.precomposeunicode=true
core.repositoryformatversion=0
credential.helper=osxkeychain
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=git@github.com:tyleretters/nor.the-rn.info.git
user.email=tyler@etters.co
user.name=Tyler Etters

=== Our Config Information ===
Git Config Path Information
Using config path: /etc/gitconfig
Using config path: /Users/mbp/.config/git/config
Using config path: /Users/mbp/.gitconfig
Using config path: /Users/mbp/projects/nor.the-rn.info/.git/config

Our config output is different to the Git config output
branch.master.merge=refs/heads/master
branch.master.remote=origin
core.bare=false
core.filemode=true
core.ignorecase=true
core.logallrefupdates=true
core.precomposeunicode=true
core.repositoryformatversion=0
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=git@github.com:tyleretters/nor.the-rn.info.git
user.email=tyler@etters.co
user.name=Tyler Etters

=== Git Attributes Information ===
git check_attr --all output

=== Our Modified Files Newline Normalisation and EOL Information ===
0 Likes

#14

Thank you for the additional info @tyleretters,

Most likely what is happening here is that your terminal is picking up some additional environment variables that are specific to your ssh setup.

Firstly, which shell are you using? You can get this info from the command line using echo $SHELL

Additionally, can you see any differences between the $PATH variable on the command line, and in Sublime Merge when it has been launched from the desktop. You can find this information via echo $PATH and Help > Debug Information respectively.

Thanks for your patience in resolving this issue!

- Dylan

0 Likes

#15

I’m on zsh.

# shared in both Merge Debug and $PATH
/Users/mbp/.rvm/gems/ruby-2.6.3/bin
/Users/mbp/.rvm/gems/ruby-2.6.3@global/bin
/Users/mbp/.rvm/rubies/ruby-2.6.3/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Applications/VMware Fusion.app/Contents/Public
/Library/Frameworks/Mono.framework/Versions/Current/Commands
/Users/mbp/.rvm/bin


# delta from echo $PATH
//Users/mbp/.scripts
//Users/mbp/.composer/vendor/bin
//Users/mbp/Library/Python/2.7/bin

Insides .scripts I have this git completion script and an alias for subl -> /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl. I don’t imagine the composer or Python stuff will have any impact.

Thank you for your patience in helping me!

0 Likes

#16

I think we found the issue. In my .zshrc:

# ssh
eval `ssh-agent` > /dev/null 2>&1
ssh-add ~/.ssh/2020_id_rsa 2> /dev/null

Does Merge only see keys named id_rsa?

0 Likes

#17

I’ve also got this in my .zshrc which I think came via the bash -> zsh migration with Catalina. I’m not sure what this does:

# git
fpath=(~/.zsh $fpath)
0 Likes

#18

Hi @tyleretters,

Thanks for the additional information.

While I investigate further, could you try the following instructions (the most important part being step #2): https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent

Thanks,
- Dylan

1 Like

#19

That fixed it! Thank you so much.

1 Like