# HG changeset patch # User František Kučera # Date 1555784432 -7200 # Node ID 2c10a7d30ffd4f4ea2c873b7dbc161b2af0d544e # Parent ca71e981bdb4dc7892bac268bf54893236d2af93 git clone --mirror (to apply changes force-pushed to the remote) diff -r ca71e981bdb4 -r 2c10a7d30ffd vcs-backup.sh --- a/vcs-backup.sh Sat Apr 20 18:51:34 2019 +0200 +++ b/vcs-backup.sh Sat Apr 20 20:20:32 2019 +0200 @@ -139,8 +139,8 @@ url=$(cat "$VCS_BACKUP_CONFIG_DIR/$d/url.txt"); if isValidTypeAndURL "$vcsType" "$url"; then - if [[ "$vcsType" == "hg" ]]; then hg clone -U "$url" "$VCS_BACKUP_CURRENT_DIR/$d"; - elif [[ "$vcsType" == "git" ]]; then git clone --bare "$url" "$VCS_BACKUP_CURRENT_DIR/$d"; + if [[ "$vcsType" == "hg" ]]; then hg clone -U "$url" "$VCS_BACKUP_CURRENT_DIR/$d"; + elif [[ "$vcsType" == "git" ]]; then git clone --mirror "$url" "$VCS_BACKUP_CURRENT_DIR/$d"; fi && echo "cloned" > "$VCS_BACKUP_CONFIG_DIR/$d/state.txt"; else echo "Unsupported VCS type: '$vcsType' or URL: '$url'" >&2;