Managing and viewing branches in a GIST

1.5k views Asked by At

I created a gist and cloned it locally where I am happily managing it. I also created a development branch and committed/pushed it (mainly as an exercise to understand git). I can see and manage all of this using posh~git locally, but I can't find any trace of the new branch in my gists at https://gist.github.com or in my git repo's.

Is this a basic (and understandable) limitation of the gist interface or is there a way to select branches on a gist?

My motivation is to share rendered the gists using references to the included assets.

2

There are 2 answers

0
VonC On BEST ANSWER

but I can't find any trace of the new branch in my gists at https://gist.github.com or in my git repo's.

Not only gists do not support branches, but the default branch has just (Feb. 2022) changed:

Gists Now Support Alternative Default Branch Names

As you may or may not know, gists are actually Git repositories.
New gists are now created with a default branch name of either main or the alternative default branch name you've defined in your user settings.

(See git config --global init.defaultbranch xxx, in Git 2.28+, Q3 2020)

This matches how other repositories are created on GitHub.

7
o11c On

This is a limitation of gist.github.com. If you need to use other features, make it an ordinary repo under github.com instead of a gist.

I am not aware of any feature that gist has that ordinary repos do not have.