The current branch is not configured for pull No value for key branch.master.merge found in configuration

后端 未结 17 870
太阳男子
太阳男子 2020-11-30 16:44

I get this error when I try to pull from remote repository using Egit team>pull

The current branch is not configured for pull No value for key branc

相关标签:
17条回答
  • 2020-11-30 16:46

    git repository view -> + branches -> local -> select the local branch you want to assign to the remote one -> right click -> select the remote (probably origin) and the upstream branch

    0 讨论(0)
  • 2020-11-30 16:49

    I also had problems to configure it. It is working now so I'm going to share my configuration file. I think it will help:

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

    Note: https://github.com/chelder86/ArcadeTongame.git should be replaced with your own HTTPS clone URL.

    0 讨论(0)
  • 2020-11-30 16:51

    Same problem. Here's how I solved it within eclipse/egit:

    Originally I cloned a remote repo to my office computer (my own repo, but on a remote server). Then I created a new branch of repo project locally ("testing"), and pushed it to remote repository. Cloned remote repo to my laptop, switched to "testing" branch, worked on it, etc., pushed, then came back to office. When I tried to pull "testing" changes from server, got msg "local branch not configured for pull".

    Problem is that on desktop, "testing" is local only, does not have remote URL info, so cannot pull changes.

    I solved this within eclipse (egit) by:

    1. deleting local branch
    2. pull branch from remote repo as new branch.

    Steps were:

    • Go to Git Repository Exploring perspective
    • rename local branch "zzz" (paranoid, don't like deleting until sure I've got it right!)
    • rt-click "Branches", "Switch to", "New Branch"
    • pull down "Source ref" list, select "testing" branch (pull strategy "merge", "Checkout new branch" checked)
    • click "finish"
    • Switch to usual perspective, make sure my files are present
    • switch back to Git Repository Exploring and delete branch "zzz"

    Note: am running Eclipse Indigo . Steps may be different on other releases.

    0 讨论(0)
  • 2020-11-30 16:51

    About gview's solution:

    then find the .git directory in that working directory and edit the .git/config file with a text editor
    

    You don't need to find it yourself or open it with a text editor.

    • Window -> Show view -> Other -> GIT -> Git Repositories
    • Expand the repo folder you created.
    • It will contain a folder called "Working Directory" expand it.
    • There will be a folder inside the "Working Directory" folder called ".git" expand it.
    • Inside ".git" there will be "config", right click "config" -> open in editor. The config file will open right in Eclipse where you can edit it. I added the following and now I can pull without errors:

    [branch "master"]

    remote = origin

    merge = refs/heads/master

    0 讨论(0)
  • 2020-11-30 16:53

    You need to replace your config file with this code.. your config file is located inside 'git' folder in your repository. The 'git' folder is hidden so first you have to show the hidden files. Open the config file and write these codes :-

    [core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    
    
    hideDotFiles = dotGitOnly
    [remote "origin"]
    url = 'url to the git repository that you want to pull'
    fetch = 
    
    +refs/heads/*:refs/remotes/origin/*
    puttykeyfile = 
    [branch "master"]
    remote = origin
    merge = refs/heads/master
    [gui]
    wmstate = normal
    
    
    geometry = 887x427+66+66 171 192
    
    0 讨论(0)
  • 2020-11-30 16:55

    I got the same issue in Eclipse Neon. But none of the solution worked for me. I got the issue when I changed branch of the project and then it threw this error.The solution I tried is:

    1. Go to project/.git/config file.
    2. If rebase = false, remove it.
    3. Refresh your project.
    4. Do git pull or pull from eclipse.
    5. Error resolved.

    PS: As it is an old thread, just updating as this might come in for someone else.

    0 讨论(0)
提交回复
热议问题