Skip to content

feat(local): Add mirror mode#308

Merged
cooperspencer merged 2 commits into
cooperspencer:mainfrom
soar:feature/local-mirror-mode
Apr 5, 2025
Merged

feat(local): Add mirror mode#308
cooperspencer merged 2 commits into
cooperspencer:mainfrom
soar:feature/local-mirror-mode

Conversation

@soar

@soar soar commented Mar 28, 2025

Copy link
Copy Markdown
Contributor

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

cooperspencer commented Apr 1, 2025

Copy link
Copy Markdown
Owner

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

soar commented Apr 5, 2025

Copy link
Copy Markdown
Contributor Author

@cooperspencer

Copy link
Copy Markdown
Owner

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

@cooperspencer cooperspencer merged commit eadd2f7 into cooperspencer:main Apr 5, 2025
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