Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get branch name on detached head? #343

Closed
sirvon opened this issue Aug 21, 2015 · 2 comments
Closed

How to get branch name on detached head? #343

sirvon opened this issue Aug 21, 2015 · 2 comments

Comments

@sirvon
Copy link

sirvon commented Aug 21, 2015

I'm getting this error frequently....

TypeError: HEAD is a detached symbolic reference as it points to XXXXXXXXX

No way to avoid it, as I'm not in control of the system at hand.

But I still need the branch name.

Is there anyway to get the branch name even with a detached head?

@Byron
Copy link
Member

Byron commented Aug 21, 2015

In fact there is no branch name if the HEAD reference is detached. Maybe this resource will be helpful to you.

Before asking for the name, one could check for the state of the symbolic reference using the is_detached property.

Please let me know if this solves it for you.

@Byron Byron added this to the v1.0.2 - Fixes milestone Aug 21, 2015
@Byron Byron modified the milestones: v1.0.2 - Fixes, v1.0.3 - Fixes Feb 13, 2016
@Byron Byron modified the milestones: v2.0.0 - Features and Fixes, v2.0.1 - Bugfixes Apr 24, 2016
@Byron Byron removed this from the v2.0.7 - Bugfixes milestone Jul 17, 2016
@Byron
Copy link
Member

Byron commented Jul 23, 2016

Closed due to inactivity. Please comment to get it reopened.

@Byron Byron closed this as completed Jul 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants