git clone --mirror v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 20 Apr 2019 20:20:32 +0200
branchv_0
changeset 82c10a7d30ffd
parent 7 ca71e981bdb4
child 9 66728b983b41
git clone --mirror
(to apply changes force-pushed to the remote)
vcs-backup.sh
     1.1 --- a/vcs-backup.sh	Sat Apr 20 18:51:34 2019 +0200
     1.2 +++ b/vcs-backup.sh	Sat Apr 20 20:20:32 2019 +0200
     1.3 @@ -139,8 +139,8 @@
     1.4  		url=$(cat "$VCS_BACKUP_CONFIG_DIR/$d/url.txt");
     1.5  
     1.6  		if isValidTypeAndURL "$vcsType" "$url"; then
     1.7 -			if   [[ "$vcsType" == "hg"  ]]; then  hg clone -U     "$url" "$VCS_BACKUP_CURRENT_DIR/$d";
     1.8 -			elif [[ "$vcsType" == "git" ]]; then git clone --bare "$url" "$VCS_BACKUP_CURRENT_DIR/$d";
     1.9 +			if   [[ "$vcsType" == "hg"  ]]; then  hg clone -U       "$url" "$VCS_BACKUP_CURRENT_DIR/$d";
    1.10 +			elif [[ "$vcsType" == "git" ]]; then git clone --mirror "$url" "$VCS_BACKUP_CURRENT_DIR/$d";
    1.11  			fi && echo "cloned" > "$VCS_BACKUP_CONFIG_DIR/$d/state.txt";
    1.12  		else
    1.13  			echo "Unsupported VCS type: '$vcsType' or URL: '$url'" >&2;