Skip to content

Instantly share code, notes, and snippets.

View hogliux's full-sized avatar

Fabian Renn hogliux

  • London
View GitHub Profile
@sarah-j-smith
sarah-j-smith / Tar pipe
Last active October 20, 2024 07:22
The amazingly awesome tar pipe command for copying trees of files around
# 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 -)