ansible: Correct git mirror update script initial clone
authorKienan Stewart <kstewart@efficios.com>
Tue, 29 Aug 2023 13:35:13 +0000 (09:35 -0400)
committerKienan Stewart <kstewart@efficios.com>
Tue, 29 Aug 2023 13:35:13 +0000 (09:35 -0400)
When '--mirror' isn't set, the remote references aren't always
pulled. To fix an existing repository that is just a bare clone, the
following commands can be run:

```
git remote rm origin
git remote add --mirror=fetch origin URL
git fetch --all
```

Change-Id: I9b713fe2dae523ba70a387adef23e87f98bb059a

automation/ansible/roles/gitmirror/files/update.sh

index d4379db17c439170653c51d536ade2040a247430..dabb4afa77360acd6eb757303d0ec458593cb41f 100644 (file)
@@ -9,7 +9,7 @@ update_git() {
     local origin="$2"
 
     if [ ! -d "${repodir}" ] ; then
-        git clone --bare "${origin}" "${repodir}"
+        git clone --mirror "${origin}" "${repodir}"
     fi
 
     pushd "$repodir"
This page took 0.023236 seconds and 4 git commands to generate.