Last active
October 20, 2024 07:22
-
-
Save sarah-j-smith/d3eddd59ba87aacef814358570312480 to your computer and use it in GitHub Desktop.
The amazingly awesome tar pipe command for copying trees of files around
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://blog.extracheese.org/2010/05/the-tar-pipe.html | |
SRC=existing-source-controlled-proj | |
DEST=copy-of-proj-with-no-git-data | |
# on Linux and WSL use gnu tar exclude VCS to prevent copying the git data | |
(cd ${HOME}/depot/${SRC} && tar --exclude-vcs cf - .)|(cd ${HOME}/depot/${DEST} && tar xvfp -) | |
# on Mac the --exclude-vcs is not available - can add --exclude .git | |
(cd ${HOME}/depot/${SRC} && tar --exclude='.git' cf - .)|(cd ${HOME}/depot/${DEST} && tar xvfp -) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment