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

Get default branch from remote #25

Closed

Conversation

kvart714
Copy link
Contributor

@kvart714 kvart714 commented Mar 29, 2021

Hello :)

My personal favorite option is default branch. But we have many repositories and the default name is different everywhere: master, dev, develop, release, qa...
I suggest getting the default branch name as origin/HEAD with the same command that gets the branch name for HEAD. This works fine with the rev-parse --abbrev-ref, but I'm not sure how it would work with the symbolic-ref

@kvart714 kvart714 force-pushed the get-default-branch-from-remote branch from 5cff7ab to 2f7378a Compare March 29, 2021 12:53
@kvart714
Copy link
Contributor Author

oh i see visualstudio has already been added :)

@kvart714 kvart714 force-pushed the get-default-branch-from-remote branch from 2f7378a to 2fa04d8 Compare March 29, 2021 14:01
@reduckted
Copy link
Owner

Thanks for the contribution. Can you split these changes into two pull requests, please? One for the Azure DevOps change, and another for the default branch change. That will make it easier to review and merge. Thanks.

@kvart714 kvart714 force-pushed the get-default-branch-from-remote branch from 2fa04d8 to 6ba265e Compare April 4, 2021 12:33
@kvart714
Copy link
Contributor Author

kvart714 commented Apr 4, 2021

Done. Second PR: #27

@reduckted
Copy link
Owner

Thanks. I like the idea of using origin/HEAD to find out what the default branch is on the remote, but I don't want to change any configuration keys, because that could break some people's current configurations.

I should have some time this later week to look into this further. I'll see if I can find a good way to do it. 😄

@reduckted
Copy link
Owner

Implemented in 9fbba6b and available in v2.5.0.

Thanks for your help! 😄

@reduckted reduckted closed this Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants