A simple git fetch
should be enough.
That will bring origin/test to your repo.
Then a git checkout -b test origin/test
will declare that branch locally.
The OP Gabriel Petrovay confirms (in the comments) the source of the problem:
There is a slight change in the git config file.
- In the newly cloned repo
[remote "origin"]
hasfetch = +refs/heads/*:refs/remotes/origin/*
- but the old repo has
fetch = +refs/heads/master:refs/remotes/origin/master
.I kind of feel this is the issue.
It is indeed.
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
That should solve it.