Eclipse & eGit: can't push to GitHub

Discussion in 'Plugin Development' started by Bone008, Jan 4, 2012.

Thread Status:
Not open for further replies.
  1. Well, now it is up to me having a problem ;)
    I use the eGit plugin for Eclipse to push my code to my GitHub repo(s). For some reason this no longer works ...

    I did a couple of commits locally for my plugin, everything is showing up fine, but when I try to push the changes to GitHub, I get the following error (after entering my global storage password):
    Code:
    Can't connect to any repository: https://Bone008@github.com/Bone008/RoutePlanner.git (An internal Exception occurred during push: https://Bone008@github.com/Bone008/RoutePlanner.git: not authorized)
    After restarting Eclipse a dozen of times, playing around with some settings (can't understand why it tells me "not authorized", I didn't change any password and it always worked before ...), I now sometimes just get this popup:
    Image (open)
    [​IMG]


    I followed this tutorial to set everything up:
    http://forums.bukkit.org/threads/github-and-eclipse.40351/
    And it used to work before ...

    The GitHub repo is here:
    https://github.com/Bone008/RoutePlanner
    And the HTTP link that shows up (which uses https, actually) does match and I of course have Read+Write access as I am the owner.

    The same applies for my other plugin DeathControl, btw. Tried it multiple times.
    And now tried it once more, and ... it worked. Same settings. I am out of options oO

    For RoutePlanner, it still won't work. It is always rejected (image above). I think the error above that only shows up when I enter a wrong password, not sure ...

    Anyone got an idea why this happens?
     
  2. Offline

    mmiillkkaa

    Try replacing https:// with git://
     
  3. That doesn't get accepted if I just change it leaving the previous https url:
    Reason: User not supported on git protocol.
    Image (open)
    [​IMG]

    I previously had it exactly the same (just with a password entered of course), just with https.

    Removing the user part (deleting "Bone008@"), then I get a response telling me to use "git@github.com:Bone008/RoutePlanner.git", if I do that (leaving out any protocol declaration in the URL), I get an Auth fail:
    Code:
    An internal Exception occurred during push: git@github.com:Bone008/RoutePlanner.git: Auth fail
    Which doesn't surprise me, I never entered my password there ...
     
  4. Offline

    Darkman2412

  5. Thanks for the suggestion, but I already tried that (see above, I just screwed something up with formatting so it wasn't visible before). Maybe you can tell me how/where to actually enter my login data?

    With that address, in the "Authentication" part of the above interface is "git" the value for username (because the link is "git@..."). If I change that or only add my password below, it doesn't change anything - always the same "Auth fail" response.

    It is really weird, cause it previously worked with the https method, and it still works for DeathControl on the same account (https://github.com/Bone008/DeathControl).
     
  6. Offline

    desht

    I'm using remotes of the form "ssh://git@github.com/desht/ScrollingMenuSign", which works fine. Obviously when using ssh, you need to generate a public key for yourself and copy into it your git profile - that's in github's Account Settings -> SSH Public Keys (https://github.com/account/ssh).

    From the commandline (using git on Linux):
    Code:
    $ git remote -v
    origin	ssh://git@github.com/desht/ScrollingMenuSign (fetch)
    origin	ssh://git@github.com/desht/ScrollingMenuSign (push)
    
    Using EGit, you should be able to right-click your project, and go to Team -> Show in Repositories View (you might want to maximise the resulting Git Repositories window). Then you can configure your remotes by right-clicking the Remotes section under your Eclipse project.
     
  7. @desht I generated a SSH public key when I first started using GitHub in combination with git bash (that command line thingy). Then I moved to eGit because I wanted it to be integrated in Eclipse for faster comitting and stuff.

    Now I set up ssh like you suggested for eGit, copying the public key I previously created to the location where eGit looks for it, and ... well, I get as far as I got with https: The first step works (auth), but pushing gives me still a rejected window like that:
    Image (open)
    [​IMG]
    Only difference is that under "Message Details", it now states "Repository ssh://git@github.com/Bone008/RoutePlanner.git" instead of what is shown in the image (makes sense ofc since the URL is like that).

    I can't understand why it always rejects my pushes. I'm the only developer, there are 2 new commits to push. The last push was 9 days ago from within eGit with the same https remote that no longer works.

    I now even tried using git bash to test if that would still work, and it does, with the same ssh settings as with eGit.
    Commit is here: https://github.com/Bone008/RoutePlanner/commit/2bdaccfa5d26e04d77fd16be4d83c6aac78b8ba1 (just an outdated file that happened to be in the directory where git bash has its repository ...)
     
  8. Offline

    Technius

  9. Offline

    desht

    EGit isn't terribly helpful when it comes to errors, which is why it's no substitute for the command line (although it is certainly a convenience).

    If you use the command line to do "git push origin master" (replace "origin" with whatever you named your github remote as), what does it say? I'm assuming git bash works the same as standard git on Linux, I'm not familiar with this strange Windows environment :rolleyes:
     
  10. Pull wasn't available (it said something that it isn't configured to pull, and I couldn't find anything to actually configure it ...), but I tried fetch, which created me a new branch that now contains the version that is on GitHub.
    The local master branch stayed untouched, though, there are no changes to commit and pushing still is rejected.

    So I have 2 branches now in eGit:
    Code:
    Branches
    -- Local
    -- -- master
    -- Remote tracking
    -- -- remotemaster
    (I called the fetched branch "remotemaster")
    Was that correct? What can I do now to combine those branches? Is that what "merge" does?
    Or can I just take the remotemaster branch and make it my local master branch (so every local code changes & commits are deleted), then restore the code via a backup, then make a commit that includes all the changes, and THEN push?

    Sorry, I not really have a clue about git ...

    @desht
    I'm pretty sure git bash works the same as on Linux, it is a stand-alone console providing some basic unix commands (for example ls, yay ;)) and of course all those "git ..." commands.
    Using "git push origin master" gives me an everything up to date response. Its whole working thing is in a different directory, though (also the source files), and I did the last test commit from there, so that doesn't surprise me ;)


    TL;DR: The current question/problem is:
    Having 2 branches in eGit, one up to date with GitHub, one with newer code and commits.
    How to I make the latter branch able to be pushed to GitHub?
     
  11. Offline

    Technius

    Make sure your push is pushing to that branch, I think it's in Team > Remote > Configure Push to Upstream
     
  12. That option (as well as everything else with "... to upstream") is grayed out.
    But to what other branch could I push, on GitHub, only the master branch exists?
     
Thread Status:
Not open for further replies.

Share This Page