![rsync를 사용하여 git 하위 디렉터리 없이 디렉터리를 백업하는 방법](https://linux55.com/image/3929/rsync%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20git%20%ED%95%98%EC%9C%84%20%EB%94%94%EB%A0%89%ED%84%B0%EB%A6%AC%20%EC%97%86%EC%9D%B4%20%EB%94%94%EB%A0%89%ED%84%B0%EB%A6%AC%EB%A5%BC%20%EB%B0%B1%EC%97%85%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95.png)
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
내가 더 잘할 수 있을까?
답변1
.git에 대한 명시적 제외를 추가하면 됩니다.
rsync -a --exclude='.git/' --include='*.c' --include='*.sh' --include='*/' --exclude='*' ~/c/ ~/Dropbox/Public/c
~/.cvsignore
또 다른 옵션은 다음 줄과 제외하려는 다른 디렉터리를 포함하는 디렉터리를 만드는 것입니다 .
.git/
답변2
을 사용할 수도 있습니다 rsync --cvs-exclude
. 또한 .git
디렉토리를 무시합니다.
그러나 이는 core
Magento 소스 파일에 나타나는 디렉터리도 무시한다는 점에 유의하세요.