Open echarrod opened 1 year ago
I found the Fallback branch
option now, but is it possible to load this dynamically instead of having to specify it?
It may be possible to do something a little more clever than it currently does. But it would only really work if the branches were named something standard like master
or main
, otherwise it would have no way to know which branch to look for. This is a nice suggestion though, it might be something that gets added in the future.
You can check the remote head to determine what the remote considers the default branch: git rev-parse --abbrev-ref origin/HEAD
. This unfortunately isn't set if the remote was added manually but it is set for the remote a repo was cloned from. It can also be fetched using git remote set-head origin --auto
.
If I am on a branch which is not pushed, with a commit on it, the link generated is:
When this should instead be (for my repo):
Is it possible to look up what the main branch is, so that it can be correctly loaded, in the event that the local branch is not present on origin?