[英]Git - pull only changed files into a separate folder
Situation: I would like to do a git pull, but then the new files have to be moved to an offline machine. 情况:我想进行git pull,但是新文件必须移至离线计算机。
The question is: Is it possible to download into a new folder only the files that are changed since the current commit? 问题是:是否可以仅将自当前提交以来已更改的文件下载到新文件夹中? If it would keep the folder structure, that also would be awesome!
如果它能保留文件夹结构,那也太棒了!
You could write a shell script to do it. 您可以编写一个shell脚本来做到这一点。
Assuming you are on the master
branch and your changes live on the origin
remote: 假设您位于
master
分支上,并且所做的更改位于origin
远程服务器上:
git fetch origin
git fetch origin
获取最新更改 git checkout origin/master
git checkout origin/master
git diff --name-status master..origin/master
git diff --name-status master..origin/master
git checkout master
git checkout master
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.