Ada*_*dam 57 git rsync dropbox
我想复制我的c
目录以及不包括./git
子目录的所有子目录。我使用rsync
:
echo "copy c and sh files "
rsync -a --include='*.c' --include='*.sh' --include='*/' --exclude='*' ~/c/ ~/Dropbox/Public/c
# remove .git directory = do not send it to dropbox. Thx to Tomasz Sowa
rm -rf ~/Dropbox/Public/c/.git
Run Code Online (Sandbox Code Playgroud)
我能做得更好吗?
小智 70
只需为 .git 添加一个明确的排除:
rsync -a --exclude='.git/' --include='*.c' --include='*.sh' --include='*/' --exclude='*' ~/c/ ~/Dropbox/Public/c
另一种选择是创建~/.cvsignore
包含以下行以及您要排除的任何其他目录:
.git/
seb*_*ner 39
你可以只使用rsync --cvs-exclude
. 它还忽略.git
目录。
但请注意,这也会忽略core
在 Magento 源文件中调用的目录。
归档时间: |
|
查看次数: |
44439 次 |
最近记录: |