Reputation: 13600
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 branch.master.merge found in configuration
Upvotes: 166
Views: 86784
Reputation: 39
While committing, if you encounter this problem. Try this simple approach:
You branch get configured to pull/push. Your code changes will be pushed to repositary.
Thanks
Upvotes: 0
Reputation: 1109
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:
PS: As it is an old thread, just updating as this might come in for someone else.
Upvotes: 0
Reputation: 29
edit the config file in your repository .git folder like this.
replace https://github.com/your/uri
to your github repository uri.
good luck.
[core]
symlinks = false
repositoryformatversion = 0
filemode = false
logallrefupdates = true
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "origin"]
url = https://github.com/your/uri
fetch = +refs/heads/*:refs/remotes/origin/*
ps: use idea, forget eclipse
Upvotes: 1
Reputation: 61
The simplest solution I've found while using the Eclipse Git plugin is as follows:
After this completes, the branch will now be correctly configured for pull as well.
Upvotes: 1
Reputation: 734
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
Upvotes: 0
Reputation: 14520
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
Upvotes: 2
Reputation: 3987
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.
Upvotes: 18
Reputation: 1175
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.
[branch "master"]
remote = origin
merge = refs/heads/master
Upvotes: 3
Reputation: 6487
To fix this problem in Eclipse, open the Windows menu and select Show View / Other / Git Repositories.
From the Git Repositories tab:
Again, from the Git Repositories tab:
Again, from the Git Repositories tab:
(1)
Key = branch.master.remote
Value = origin
(2)
Key = branch.master.merge
Value = refs/heads/master
Upvotes: 57
Reputation: 1880
This worked for me:
Right-click my checked-out local branch that can't pull (mine's called "development") Select "Configure Branch..." For "Upstream Branch:", I selected "refs/heads/development" For "Remote:" I selected "origin" Left "Rebase" unchecked Hit OK
Now my config pref window looks like the one in gview's answer.
Upvotes: 47
Reputation: 500
The current branch is not configured for pull.
No value for key branch.master.merge found in configuration
An alternative for PULL (avoiding above error) is:
Upvotes: 2
Reputation: 21
Try windows->Show View->Navigator. In the Navigator windows, find bin folder in your project Then commit bin folder to github and hope it work well. Try pull or fetch it after all task above.
Upvotes: 2
Reputation: 53786
I just got the same issue but accepted answer did not work for me. Here's what I did (although I can't confirm if accepted answer had an impact as the updated config remains) :
Expand your git repository tree from 'Git Repositories' view.
Right click on 'Remotes' and select 'Create Remote'
Select radio button 'Configure fetch' -> 'Ok'
Select 'Change' opposite 'URI' text box
Enter your git repository details and click 'Finish'
Select 'Save'
You should now be able to pull from the remote repository.
Note - when I tried 'Dry-Run' which I think is just a connection test it failed but the pull still worked.
Upvotes: 9
Reputation: 101
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:
Steps were:
Note: am running Eclipse Indigo . Steps may be different on other releases.
Upvotes: 10
Reputation: 15361
As it turns out, @Michał Szajbe's answer IS the solution to the problem. The eclipse keys in question are built from the egit "working directory". Should you encounter this problem, then find the .git directory in that working directory and edit the .git/config file with a text editor, adding the section Michal describes. This is in my experience a fairly standard operation these days for cases when you first git init and push to an uninitialized remote, that creates the master branch. I haven't found a way in that case not to do the manual editing in order to git pull, even with command line git.
After the edit is saved, right click on the git repo in your egit "Git Repositories" perspective, and choose properties, you will now see this section of keys has been created (or more likely just read from the config file) and a remote master to local master git pull will operate as expected going forward.
It's possible that you could enter these keys and values yourself, but copying and pasting what Michal shows is certainly a lot faster and probably safer. I didn't actually try adding the keys manually through the property editor nor am I likely to, as I know this method works, and makes sense since egit is simply calling through to the local git repo.
I am also supporting some people in my office who are using Flex and the Flexbuilder editor which is built on top of eclipse and egit. These instructions are equally relevant to them.
Upvotes: 64
Reputation: 21
What I found that worked using eclispe (this is certainly not the right way to go about this but it works): push to remote repository, delete local workspace and repository, import from git using the import dialogue. The import wizard takes care of setting everything up for future pulls.
Upvotes: 2
Reputation: 9003
Your local master branch is not set up to track remote master branch.
You could do git pull origin master
to tell git the explicit branch you want to pull or you add this to your .git/config:
[branch "master"]
remote = origin
merge = refs/heads/master
When you push to master for the first time, add the -u
switch (git push -u origin master
). This will set everything up automatically.
Upvotes: 156