# From inside the SVN subdir you want to extract: set -euo pipefail DEST="${1:-trunk-git}" echo "Exporting SVN working copy to $DEST (versioned files only)..." rm -rf -- "$DEST" count=0 start_ts="$(date +%s.%N)" svn export . "$DEST" | awk -v start="$start_ts" ' function elapsed() { cmd = "date +%s.%N" cmd | getline now close(cmd) split(start, s, ".") split(now, n, ".") return (n[1]-s[1]) + (n[2]-s[2])/1e9 } { count++ if (count % 50 == 0) { t = elapsed() printf("\r[%.1fs] Exported %d items...", t, count) fflush() } } END { t = elapsed() printf("\r[%.1fs] Exported %d items.\n", t, count) } ' cd "$DEST" git init git config init.defaultBranch trunk || true git add -A git commit -m "Import SVN snapshot" || true