Convert GitHub Gist to GitHub Repository
GitHub Gists give good visibility in search engines and GitHub Search. Gists integrate well using site generators including Hugo. However, GitHub Gists do not support GitHub Actions, Discussions, etc. Gists also do not allow directory structure. Once a Gist reaches a certain feature level or number of files, it may be more useful to share the content as a GitHub Repository. GitLab Snippets have similar characteristics and can be converted to GitLab Repositories similarly.
Simply import the Gist URL to a new Repository. Once satisfied with the imported Repository, the Gist can be deleted, or leave a simple note pointing to the new Repository URL.
Another more general approach is to simply tell Git to use the new repository as origin like:
git remote set-url origin https://github.com/username/repository.gitAn advantage of these methods rather than just copying the files over is the Gist history is preserved as Git commits. If Git was used to manage the Gist, commit messages are preserved. Edits made to the Gist in the web editor don’t have commit messages.