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