简体   繁体   中英

Getting a file from a branch into GIT

So I updated all of my repositories from origin with git fetch, and this downloaded several files from my non-master branch (let's call it "test", for argument). However it did not update a particular file that I wanted to update to that branch - let's call it "file.name".

File.name already existed locally, but I want to overwrite it with this branch - how would I go about doing that? I have changes that I want to checkout and see if they work.

git cat-file是执行此操作的一种方法:

git cat-file -p master:dir/dir/dir/file.txt > file.txt

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