Last active
November 9, 2015 14:39
-
-
Save kitsuyui/07aee196be32949e2fd8 to your computer and use it in GitHub Desktop.
git-new-workdir + rsync でワーキングディレクトリの Git 管理外のファイルも複製する ref: http://qiita.com/kitsuyui/items/4c4c3122f96605e221d6
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
#!/usr/bin/env bash | |
set -eu | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: $0 source_dir target_dir" >&2 | |
exit 1 | |
fi | |
srcdir="$1" | |
dstdir="$2" | |
git-new-workdir "$srcdir" "$dstdir" | |
rsync -Hax --exclude .git "$srcdir/" "$dstdir" |
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
#!/usr/bin/env bash | |
set -eu | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: $0 source_dir target_dir" >&2 | |
exit 1 | |
fi | |
srcdir="$1" | |
dstdir="$2" | |
git-new-workdir "$srcdir" "$dstdir" | |
rsync -Hax --exclude .git "$srcdir/" "$dstdir" |
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
$ cp-workdir コピー元ディレクトリ コピー先ディレクトリ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment