Title: How to know which is the default branch · gitpython-developers/GitPython · Discussion #1364 · GitHub
Open Graph Title: How to know which is the default branch · gitpython-developers/GitPython · Discussion #1364
X Title: How to know which is the default branch · gitpython-developers/GitPython · Discussion #1364
Description: How to know which is the default branch
Open Graph Description: How one can one which is the default branch? main/master? One can know about this by iterating all heads and then manually check , but that is also have one issue. What if a repository has both the...
X Description: How one can one which is the default branch? main/master? One can know about this by iterating all heads and then manually check , but that is also have one issue. What if a repository has both the...
Opengraph URL: https://github.com/gitpython-developers/GitPython/discussions/1364
X: @github
Domain: Github.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"How to know which is the default branch","text":"\u003cp dir=\"auto\"\u003eHow one can one which is the default branch? main/master?\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eOne can know about this by iterating all heads and then manually check , but that is also have one issue.\u003cbr\u003e\nWhat if a repository has both the branches as their branch, which means master, main are some branch and default branch could be one of these or something else.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eHow to get the default branch ?\u003c/p\u003e","upvoteCount":2,"answerCount":3,"acceptedAnswer":{"@type":"Answer","text":"\u003cp dir=\"auto\"\u003ethis seems to work \u003ccode class=\"notranslate\"\u003erepo.remotes.origin.refs.HEAD.ref.remote_head\u003c/code\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003ebit verbose tho!\u003c/p\u003e","upvoteCount":1,"url":"https://github.com/gitpython-developers/GitPython/discussions/1364#discussioncomment-1671183"}}}
| route-pattern | /_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format) |
| route-controller | voltron_discussions_fragments |
| route-action | discussion_layout |
| fetch-nonce | v2:8279c50a-2d37-ba02-8c79-a121e32c89cd |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | DD68:2017E4:1FE28BE:2BB98E9:6A630DEF |
| html-safe-nonce | 51e7045924edb4baeed8e5aabd9cc4aefe08f7be562af89da9ba5f46401749cf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDY4OjIwMTdFNDoxRkUyOEJFOjJCQjk4RTk6NkE2MzBERUYiLCJ2aXNpdG9yX2lkIjoiODI4MTgzMDUzMjA3NjIxMTY5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b32486838308fcc4b09bc7ed0ff976b9574c01c02ddbeb8ba12f8b2d909bb30e |
| hovercard-subject-tag | discussion:3639938 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/gitpython-developers/GitPython/1364/discussion_layout |
| twitter:image | https://opengraph.githubassets.com/b8ea699f7a80791f49f4bead8e544cd64f0d19d6deca2608c232779e95992b15/gitpython-developers/GitPython/discussions/1364 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b8ea699f7a80791f49f4bead8e544cd64f0d19d6deca2608c232779e95992b15/gitpython-developers/GitPython/discussions/1364 |
| og:image:alt | How one can one which is the default branch? main/master? One can know about this by iterating all heads and then manually check , but that is also have one issue. What if a repository has both the... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1a6c056e02f174fffc096c521ec0ff6fb83e40a2ec8cb8875466ec1524872dd6 |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6a93e25585f487ddff9e3996c06d5b869d6e1828 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width