GIT 폴더에서 rsync 로 특정파일 및 폴더 빼고 복사하기


rsync 를 이용하여 GIT 이나 Repo 명령어로 받은 폴더에서 작업용 소스만을 따로 빼서 복사할 수 있다. 이렇게 하면 외부에 배포시 사이즈도 줄일 수 있고 수정 history를 공개하지 않을 수도 있다.


$ rsync -avzt --exclude=.repo --exclude=.git --exclude=.gitignore ~/git/src/ ~/work/src


라고 입력하면 ~/git/src/ 폴더의 모든 내용 중


.git

.repo

.gitignore 


폴더를 제외하고 ~/work/src 폴더에 복사하게 된다.


사용한 rsync 명령어의 option 은 아래와 같다.


-a : archive mode

-v : verbose

-z : compress file data during the transfer

- t : preserve times






Posted by 인포개더러
,