How to get only one file from another branch, but which does not exist in the current branch?

I have a very similar question to this question: stack overflow

I have two branches: ukand uk-prod:

git checkout uk-prod
Already on 'uk-prod'

git diff --name-status uk-prod..uk
A       pages/Advanced Types.md
A       pages/Basic Types.md
A       pages/Classes.md

I want to get only the file pages/Advanced Types.md:

git checkout uk -- "page/Advanced Types.md"

But git throw:

error: pathspec 'page/Advanced Types.md' did not match any file(s) known to git.

As far as I understand, this is because git does not see the local file page/Advanced Types.md. Yes or no?

+4
source share
1 answer

you have a typo - pageinstead pages: -)

+2
source

Source: https://habr.com/ru/post/1628664/


All Articles