I\'m not sure why I\'m unable to checkout a branch that I had worked on earlier. See the commands below (note: co
is an alias for checkou
On Windows OS by default git is instaled with
core.ignorecase = true
This means that git repo files will be case insensitive, to change this you need to execute:
\yourLocalRepo> git config core.ignorecase false
you can find this configuration on .git\config file
Happened to me after renaming an uncommitted file in Android Studio.
Git seemed to have the old version in its repository, even if it didn´t exist anymore.
fetch, pull, checkout, add all and so on did not help in my case!
So I opened the Git GUI of TortoiseGit which showed me the exact file that caused trouble.
Afterwards I deleted the file from the repository with
git rm -r --cached /path/to/affected/file
and the problem was gone
check whether it is not a typo in the target file name. I was attempting to stage by typing
git add includes/connection..php
But I did not notice that I was using two dots But then I type
git add includes/connection.php
It works
I got this error for a branch that was remote and had no local tracking branch. Even though I'm certain I've checked out remote branches via a simple
git checkout feature/foo
in the past, to get around this error I had to
git checkout -t -b feature/foo origin/feature/foo
I have no idea what I did to get myself into that situation either.
I fixed it by modifying my git config file
Check your the config file in your git directory - .git\config
It previously had
[remote "origin"]
url = http://git.xyz.com/abc-group/pqr.git
fetch = +refs/heads/develop:refs/remotes/origin/develop
I fixed by modifying it to
[remote "origin"]
url = http://git.xyz.com/abc-group/pqr.git
fetch = +refs/heads/*:refs/remotes/origin/*
Notice the head was pointing to only one branch, so it couldnt find the reference to other existing branches, I changed it to * so it checks everything in origin.
git pull
That simply fixed it for me :)