Skip to content

Instantly share code, notes, and snippets.

@perXautomatik
Forked from YumaInaura/README.md
Created July 26, 2021 14:09
Show Gist options
  • Save perXautomatik/49b768e0deaa4bbf0fcd849432de2f51 to your computer and use it in GitHub Desktop.
Save perXautomatik/49b768e0deaa4bbf0fcd849432de2f51 to your computer and use it in GitHub Desktop.
Gist — Manage in one repository many gists by using git submodule

Gist — Manage in one repository many gists by using git submodule

Gist is a nice service. We can write code so easily and manage files as repository.

But bad points are …

  • Many repository
  • Gist destributes random hash to perticular gists (repositories).
    • So difficult to find or remember contents as repository.

So let's manage them in one normal Github repository.

Create Github normal repository ( for aggregate many gists )

Example:

https://github.com/YumaInaura/gist

Create gist

From web

image.png

Distributed Gist URL example:

https://gist.github.com/YumaInaura/8d52e73dac7dc361745bf568c3c4ba37

Add gist repository to aggregation repository by git submodule

Command:

git submodule add [Gist URL] [Some directory name easy to remember]

Example:

git submodule add https://gist.github.com/YumaInaura/8d52e73dac7dc361745bf568c3c4ba37 understandhing_channel_buffer

Commit and push to aggregation repository

Then we can manage "submodule managed repositories".

Github view

We can find link from aggregation repository to gist.

image.png

image.png

Example page:

https://github.com/YumaInaura/gist/tree/master/go

Clone aggregation repository

Use --recurse-submodules option then we can clone all submodule managed files.

Exmaple:

git clone --recurse-submodules https://github.com/YumaInaura/gist

Careful, If include many submodules, then many clones happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment