10

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.

Cool Blue
  • 6,438
  • 6
  • 29
  • 68

2 Answers2

8

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.

o11c
  • 15,265
  • 4
  • 50
  • 75
  • So what happens to the commits on the remote? They are just there in the database but not available through the UI? – Cool Blue Jun 24 '15 at 05:41
  • 3
    @CoolBlue Right. Any access over `git://` or `ssh://` is fully-featured, only the website has less features. – o11c Jun 24 '15 at 05:51
  • 1
    Sorry, I'm a bit naive, I don't understand what you mean. When you say "the website" do you mean https://gist.github.com? – Cool Blue Jun 24 '15 at 06:01
  • 2
    Right. Anything accessed over `http://` or `https://` using a web browser is a website. – o11c Jun 24 '15 at 06:03
  • OK... but, therefor, https://gist.github.com or https://github.com are websites, so I still can't resolve this statement: "Any access over git:// or ssh:// is fully-featured, only the website has less features." "the website" is ambiguous to me. – Cool Blue Jun 24 '15 at 06:38
  • 3
    gist.github.com and github.com are not websites, they're domain names. Accessing them over http/https gets you to websites, which have different sets of features. Accessing them over git or ssh connects you to entirely different software, with an entirely different set of features. tl;dr: The web interface hosted at gist.github.com is more limited than that at github.com. However, the git and ssh interfaces at gist.github.com provide full git support. – sehrgut Oct 06 '16 at 17:21
  • 2
    *"I am not aware of any feature that gist has that ordinary repos do not have."* Actually there is 1 important feature that gist has that github does not: The ability publicly share something without the hassle of issues, pull requests, etc. And that is why they created gist and keep it limited. It was intended to be an improvement to pastebin, dpaste, etc. – Bruno Bronosky Nov 16 '17 at 18:30
2

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250