I get this error everytime I try to view status of an unnamed branch. This has been happening for atleast over a year.
Not seeing this error when using command line, or when using other UI tools.
Thanks for posting the link. I converted this to an answer, and I recommend you accept it as a correct one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Michael, but my issue occurs, and continues to occur when i try to navigate to an unnamed branch - which I do quite a lot when reviewing code or 'git bisect'ing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Late to this party... however I found a solution to this problem that was occurring for me that may assist others:
navigate within finder to location of repository:
path/to/repository/.git/refs/heads
and delete the branches that are causing the issue
path/to/repository/.git/refs/remotes
do the same for any that are causing the issue.
My issue was also caused by dropbox creating a "conflicted-copy" of the heads files, creating ghost branches that weren't showing in SourceTree however they were still triggering an error and showing as valid branches in the ui for pushing to origin, and in the dropdown ui select box above the commit timeline.
Hope it helps others.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sudarshan,
I've found an Improvement Request related to a similar error message described at https://jira.atlassian.com/browse/SRCTREE-1292that was fixed in SourceTree 1.6, for which this error was happening when SourceTree tries to open orphan branches. Can you please check if this is your case?
If you believe this is related, I'd suggest adding comments to the issue above that you think could be valuable to it.
In case you think this is not related and your case needs further investigation, you might need to create a support ticket at https://support.atlassian.com
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It does sound similar, but I'm on source tree 1.9.2, and am still able to repro the issue. I'll open a support case with steps to repro.
1. on the command line, check out a branch, but don't name it
git checkout origin/<sometopicbranch>
RESULT:
Note: checking out 'origin/<sometopicbranch>'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at 605262c... formatting changes
2. Launch sourcetree from command line. Make sure the view setting is set to "current branch" and not all branches.
An error message will pop up "'git log' failed with code 128:'fatal: bad revision '(detached from origin/<sometopicbranch>)'"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.