I sometimes use the checkout -b
option to create a new branch, check it out at the same time and set up tracking in one command.
In a new environment, I get this error:
$ git checkout -b test --track origin/master
fatal: Cannot update paths and switch to branch 'test' at the same time.
Did you intend to checkout 'origin/master' which can not be resolved as commit?
Why does Git not like it? This used to work with the same repo.
You should go the submodule dir and run
git status
.You may see a lot of files were deleted. You may run
git reset .
git checkout .
git fetch -p
git rm --cached submodules
//submoudles is your namegit submoudle add ....
You can use these commands: git remote update, git fetch, git checkout -b branch_nameA origin:branch_nameB
I think maybe it's because of your local branch can not track remote branch
Strange: you need to check your remotes:
And make sure
origin
is fetched:Then:
(to see if you do have fetched an
origin/master
branch)For me I needed to add the remote:
then I could fetch