-1

All:

I am pretty new in Git, I wonder how can I replace one file with the one from master?

Foe example:

In branch DEV, I have one file called App.js, I decide to use the App.js from master branch to replace it. What is the command to do this?

Thanks

Kuan
  • 11,149
  • 23
  • 93
  • 201
  • Possible duplicate of [How to get just one file from another branch](https://stackoverflow.com/questions/2364147/how-to-get-just-one-file-from-another-branch) – phd Jul 10 '18 at 23:15

1 Answers1

2

Assuming you're on DEV branch and you want to overwrite only one file from master remote branch:

git fetch 
git checkout origin/master <filepath>
Pankaj Gadge
  • 2,748
  • 3
  • 18
  • 25