Skip to content

Commit

Permalink
Add explicit bareRepository configuration when pushing bare mirror
Browse files Browse the repository at this point in the history
If a user has configured `bareRepository=explicit` in their
configuration, the push operation in this example will fail with the
message:

    fatal: cannot use bare repository '<path>.git' (safe.bareRepository is 'explicit')

By adding `-c "safe.bareRepository=all"` to the default instruction set,
this should prevent issues for users who have bareRepository configured.

Signed-off-by: James Knight <[email protected]>
  • Loading branch information
jdknight committed Dec 5, 2024
1 parent 15926e6 commit d7fa0dd
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ You can delete a fork and recreate the same repository, without the connection t
1. Create a bare clone of the fork.

```shell
git clone --bare https://{% data variables.product.product_url %}/EXAMPLE-USER/FORK-NAME.git
git clone --bare https://{% data variables.product.product_url %}/EXAMPLE-USER/FORK.git
```

1. Delete the forked repository. For more information, see "[AUTOTITLE](/repositories/creating-and-managing-repositories/deleting-a-repository)."<br><br>
Expand All @@ -47,15 +47,13 @@ You can delete a fork and recreate the same repository, without the connection t
1. Mirror-push the repository back to the same remote URL.

```shell
cd FORK-NAME.git
git push --mirror https://github.com/EXAMPLE-USER/FORK-NAME.git
git --git-dir FORK.git push --mirror https://{% data variables.product.product_url %}/EXAMPLE-USER/FORK.git
```

1. Remove temporary local clone you created earlier.

```shell
cd ..
rm -rf FORK-NAME.git
rm -rf FORK.git
```

For more information, see [our support page](https://support.github.com/request/fork) on forks.

0 comments on commit d7fa0dd

Please sign in to comment.