简体   繁体   中英

git checkout only modified files from another branch into current

I'm fairly new to Git and here's my situation:

  • I have a master development repo for the purposes of making a website.
  • I have a branch of that repo which is dedicated only to files I want to upload to the server. (A subset of the master files)
  • I want to develop in the master branch, then when I'm ready, checkout the newest versions of the server files from the master branch to the server branch.

I realize I can git checkout master file_paths but it would be nice if git could

  1. See what files exist in the server branch
  2. Check out the newest versions of those files from the master branch.

Is there a way to do this? Or a better (faster) workflow?

Thanks!

git ls-files | sed 's/.*/git checkout master -- "&"/' | sh -x

或(我在想什么)

git ls-files | xargs git checkout master --

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