Merge Repositories
Want to change things up? Merge your snippets with another repository!
Choose Merge Snippets Repo
in the three-dot menu of Locations Manager or run snippetstudio.github.merge
in the command prompt
Precautionary Checks
Before you can merge, there are precautions to make sure it is extra safe before making potentionally drastic changes to your global snippets.
- Must be git repository with remote
- Git remote must match configuration remote
- Merge target remote must be different from current remote
- Merge target remote must exist on GitHub
Merge Options
There are three merge options. You can select one, or press ESC
to cancel.
Merge Snippets
Merge snippets from the remote repository without changing your remote. If you have a friend with a lot of snippets you want, but they don't want you modifying them, you can copy them all into your repo.
- Clones the merge target into a temp folder
- Performs a merge of all json objects (yours <-- theirs)
See the Merge Flow for a flow chart.
Collaborate
Start with their snippets, merge yours, and set their repository as your remote. Let's combine snippet repos! (Much of this is done asynchronously for efficiency).
- Clones their snippets into a temp dir
- Moves your snippets into a temp dir
- Moves their snippets into your snippets dir
- Performs a merge of all json objects (theirs <-- yours)
Important Note: This wipes your local git history and replaces it with theirs.
See the Collaborate Flow for a flow chart.
Start Fresh
Replace your local snippets with the ones from the remote repository.
- Your global snippets repo is emptied
- Runs
git pull
to snippets repository you chose.
After the Merge Step
After the merge, the extension runs git commit
and git push
.