From 7a8cb5d90a201a4e7fb278d6152a5fff0da6eae0 Mon Sep 17 00:00:00 2001 From: Fan-Wu Geoffrey Yang Date: Thu, 24 Sep 2026 12:27:40 +1200 Subject: [PATCH] Update 'Tools/Git' --- Tools%2FGit.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Tools%2FGit.md b/Tools%2FGit.md index 1747ad3..489fd1f 100644 --- a/Tools%2FGit.md +++ b/Tools%2FGit.md @@ -3,3 +3,28 @@ Git Info ----- +#### Mirroring Repos + +This mirrors a repo to your current repo +
+ +Explanation + + `git remote add {name_of_remote} {remote_url}` + Adds a remote to your instance under {name_of_remote} (any unique name you decide) which will mirror {remote_url} to your repo. + + +----- + git push origin 'refs/remotes/{name_of_remote}/:refs/heads/' --prune --tags + Pushes your remote and prunes all current branchs that don't exist on the remote anymore. + +> Warning! This means that all local work on that mirror can be lost. Generally I would recommend you don't work directly on the mirror repo. So the repo will looking like: Original > Mirrored Repo > Your Fork. + + +
+ +``` +git remote add {name_of_remote} {remote_url} +git fetch {name_of_remote} +git push origin 'refs/remotes/{name_of_remote}/:refs/heads/' --prune --tags +``` \ No newline at end of file