简体   繁体   中英

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

I have very a similar question to this question: https://stackoverflow.com/a/2364223/1716560

I have two branches: uk and 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 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, it happens because git does not see a local file page/Advanced Types.md . Yes or not?

你有一个错字 - page而不是pages :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM