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: togithub.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"How to know which is the default branch","text":"How one can one which is the default branch? main/master?
\nOne can know about this by iterating all heads and then manually check , but that is also have one issue.
\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.
\nHow to get the default branch ?
","upvoteCount":1,"answerCount":3,"acceptedAnswer":{"@type":"Answer","text":"this seems to work repo.remotes.origin.refs.HEAD.ref.remote_head
\nbit verbose tho!
","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:a8570076-b37f-ff6d-0573-f02f9f65078e |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | A69C:167F2B:A4761D:E753E6:69690C1A |
| html-safe-nonce | f9553027201b1830b2d98ce0f825f48462e7970c6e44830370ed37f67659cdeb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjlDOjE2N0YyQjpBNDc2MUQ6RTc1M0U2OjY5NjkwQzFBIiwidmlzaXRvcl9pZCI6IjE0MjY3MjQxOTgzMjE1NTY1MDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fc6ababd1bcd8a519132b2ac81eff998489721d0721b0ce391d99c4e9f1b0ab3 |
| 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 | e6156bd4ef9f2dc8dadf4c49a8f7ed8532186388cef72eda3ccb9f0ab3b8cfca |
| 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 | ee2210c3e58153aae53400c942f8a7b4bbb43ec4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width