Git cannot fetch remote branch

89 views Asked by At

I am attempting to run the command git checkout -b feature origin/feature

I have a repository I've cloned down with the below lines with help from this question: (Git Clone is too slow)

$ git clone --depth=1 git@URL/path/to/repository.git
$ git fetch --unshallow

I am now trying to fetch a remote branch. git remote -v shows I am successfully connected to the remote repository:

origin git@URL/path/to/repository.git (fetch)

origin git@URL/path/to/repository.git (push)

After running git fetch origin and git branch -a I see:

* master remotes/origin/HEAD remotes/origin/master

It seems my fetch isn't getting the remote branch listed at the URL, because running the checkout command at the top returns fatal: 'origin/feature' is not a commit and a branch 'feature' cannot be created from it

How do I fetch the origin/feature branch from the URL as a tracked branch

0

There are 0 answers