1

I'm working on remote repository with git commands on windows cmd and it works well, but when working with git commands in git bash terminal I get error:

Your configuration specifies to merge with the ref 'refs/heads/feature/branch-name'
from the remote, but no such ref was fetched.

How can I fix it for git bash terminal?

2
  • As a sidenote, feature/ is part of the branch-name. Commented Oct 8, 2021 at 7:12
  • Yes, when I work on some tasks I create a new branch to work on this task, in this case it's branch-name, and after finishing the task I make pull request to the main branch Commented Oct 8, 2021 at 8:32

2 Answers 2

2

Check first, in your git bash session, the ouput of:

git branch -avv
git status

Make sure the name of the branch you are in matches the remote one, especially considering the case (uper/lowercase), in case it is insensitive in a CMD session, and sensitive in a bash session.
See this example.

If the list of branches show the local one is not linked to a remote tracking one, then, as I documented in "[Difference between git checkout --track origin/branch and git checkout -b branch origin/branch][2]":

git branch -u origin/branch branch
Sign up to request clarification or add additional context in comments.

2 Comments

For the first command it prints the list of available branches and for the second command it prints: On branch next Your branch is up to date with 'origin/next'. nothing to commit, working tree clean
@Sakén can you edit your question with the exact output of the list of branches from the first command?
1

It started working when I moved to the main branch (next). But, when i switch back to my branch this is what I get:

$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> feature/branch-name

Finally found the answer here: Why do I have to "git push --set-upstream origin <branch>"?

git push -u origin <your-local-branch-name>

So if your local branch name is coffee

git push -u origin coffee

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.