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

FR: Allow setting for branch name #14

Closed
peirix opened this issue Jan 5, 2022 · 2 comments
Closed

FR: Allow setting for branch name #14

peirix opened this issue Jan 5, 2022 · 2 comments

Comments

@peirix
Copy link

peirix commented Jan 5, 2022

Right now it expects the main branch to be named master, but ours is main, so the build fails. It would be nice to have that setting alongside repository and user

@undergroundwires
Copy link
Owner

Hi, thanks! It makes sense. I improve some other aspects, once it's done I'll release next minor version with this feature with two changes:

  1. No more hardcoded 'master'. Default configuration will check the default branch of the origin and find out the main branch. If origin does not exist (which is a very rare use-case); it will consider master is the main branch if it exists, or main if that exists. If none exists, it will exit with an error. This would allow better zero-config start.

  2. An argument like --branch that would override the logic from 1. What you're looking for 😀

undergroundwires added a commit that referenced this issue Mar 3, 2022
Remove hardcoded 'master' branch from `git push` calls. It allows
flexibility of working with any default branch naming such as `main`.

Remove branch name when pushing tag. A tag and a branch don't have a
direct relationship. Pushing a tag does not have anything to do with
any branch. The tag points to a commit. It does not care which branch
the commit is reachable from. The commit may be on master and/or on
another branch but it's none of the tag's business.

Remove hardcored master when pushing changes. `git push` without a
specified branch will push changes on the local branch to matching
remote branch anyway.

Add related tests and extend test logic to support the new tests.
@undergroundwires
Copy link
Owner

I just realized that I was overthinking this with point 1. Just running git push without specifying any branch (removing hardcoded master) was enough to point to default branch 😀 --branch option is also introduced now, but should not be necessary. Changes are released as 1.4.0 and published to marketplace.

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

No branches or pull requests

2 participants