Skip to content

Instantly share code, notes, and snippets.

@kitsuyui
Last active November 9, 2015 14:39
Show Gist options
  • Save kitsuyui/07aee196be32949e2fd8 to your computer and use it in GitHub Desktop.
Save kitsuyui/07aee196be32949e2fd8 to your computer and use it in GitHub Desktop.
git-new-workdir + rsync でワーキングディレクトリの Git 管理外のファイルも複製する ref: http://qiita.com/kitsuyui/items/4c4c3122f96605e221d6
#!/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"
#!/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"
$ cp-workdir コピー元ディレクトリ コピー先ディレクトリ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment