Fixing the Git Error: The Current Branch is not Configured for Pull
Are you seeing an error message like below:
The current branch is not configured for pull
No value for key branch.develop.merge found in configuration
Or an error message such as the following:
The current branch is not configured for pullNo value for key remote.origin.url found in configuration
|Error message trying to pull from a remote git branch|
Most likely, you created the branch locally and you haven't set the merge section of that branch and/or your local branch is not tracking the remote branch. The problem lies in your git local configuration.
There are many ways to fix this but the most straightforward for me is the following:
Open up your Git Bash:
|Open your git bash from the Start Menu|
Right-click your project and click properties. Get the location of your project in git.
|Find the local git repo location of your project in your IDE|
Go to your git prompt:
|Git Bash command prompt|
Change your directory to your project's directory. Be sure to use forward slashes!
Checkout the branch
git checkout branchname
Then push the local branch to your remote branch using the -u flag. This will setup your pull settings automatically.
git push -u origin branchname
This should automatically update your local configuration and you should now be able to execute a git pull command for that branch from the remote repo.
Alternatively, you can modify the config directly
Then add the following entry for your branch.
remote = origin
merge = refs/heads/master