![](/img/trans.png)
[英]want to pass the password from the shell script for the scp command for transferring the file from one server to another
[英]scp all git modified file using single command to another server
我正在尝试将已更改的多个文件复制到新服务器。
为此,我遵循了以下步骤:
git status
scp filename server
上面的步骤我不得不重复多次,我可以写一个命令来做git status
然后将所有修改的文件复制到服务器
首先检查git diff --name-only --diff-filter=AM
是否会为您提供正确的列表(对于当前在工作树中添加/修改的文件,尚未添加到索引中)
如果是这样,你可以这样做
git diff --name-only --diff-filter=AM | xargs -I '{}' scp '{}' server
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.