Skip to content

Conversation

soar
Copy link
Contributor

@soar soar commented Mar 28, 2025

what

This PR adds support for cloning in the mirror mode (git clone --mirror)

The config will be slightly different. For bare repositories:

[core]
	bare = true
[remote "origin"]
	url = git@github.com:....git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master

For mirror:

[core]
	bare = true
[remote "origin"]
	url = git@github.com:....git
	fetch = +refs/*:refs/*
	mirror = true

why

Mirror mode can be considered a better alternative for bare repositories to use as backups, as it is easier and more convenient

docs

@cooperspencer
Copy link
Owner

cooperspencer commented Apr 1, 2025

I like the idea but you only added mirror to git commands. Can you also add it to the go-git part in local.go?

@soar
Copy link
Contributor Author

soar commented Apr 5, 2025

@cooperspencer
Copy link
Owner

Oh you are correct. Sorry, I overlooked that... I'll merge it.

@cooperspencer cooperspencer merged commit eadd2f7 into cooperspencer:main Apr 5, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants