eclipsesource / megit

Standalone Git GUI based on EGit
Eclipse Public License 2.0
409 stars 38 forks source link

Pull doesn't work out of the box (it does with "git pull" from terminal) #22

Closed php4fan closed 2 years ago

php4fan commented 2 years ago

I have a local clone of a github repository that I own.

When I cd into its directory and run git pull, it pulls. That means that my credentials, and/or whatever is needed for git to be able to pull from that repository, is correctly configured somewhere, whether it's in the repository folder or globally somewhere in my home folder.

However, when I do the following:

I get this error:

image

php4fan commented 2 years ago

I tried another repository and it worked out of the box, so I looked at how their configurations differed, and in the end I got it to work by changing the repository's .git/config from this:

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[branch "master"]
        remote = git@github.com:xxxxxxx/yyyyyyy.git
        merge = refs/heads/master

to this:

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = git@github.com:xxxxxxx/yyyyyyy.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master

Note that git commands from the command line worked with both versions

planger commented 2 years ago

Thanks for the feedback! Hm, it looks like JGit doesn't support defining a URL in remote of a branch directly. Sorry about that!