-
Notifications
You must be signed in to change notification settings - Fork 47
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
Make git branch name configurable #116
Comments
It is possible to specify an alternative default initial branch for git repositories. This is globally configurable with **init.defaultBranch**. See `man git-init` for details. We should be able to rely on pushing and pulling from the default branch without explicitly setting "master", or anything else. dstask will simply push and pull from the remote named "origin" using whatever default tracking branch is set. Refs naggie#116
@kevindkeogh If you are willing to build a custom branch, see my fork in #118 and see if it fixes your issues. I am having a heck of a time getting the tests to pass, though. Some kind of Go modules issue. |
This worked perfectly for me, thank you! If its any help, I ran
|
It is possible to specify an alternative default initial branch for git repositories. This is globally configurable with **init.defaultBranch**. See `man git-init` for details. We should be able to rely on pushing and pulling from the default branch without explicitly setting "master", or anything else. dstask will simply push and pull from the remote named "origin" using whatever default tracking branch is set. Refs naggie#116
It is possible to specify an alternative default initial branch for git repositories. This is globally configurable with **init.defaultBranch**. See `man git-init` for details. We should be able to rely on pushing and pulling from the default branch without explicitly setting "master", or anything else. dstask will simply push and pull from the remote named "origin" using whatever default tracking branch is set. Refs naggie#116
It is possible to specify an alternative default initial branch for git repositories. This is globally configurable with **init.defaultBranch**. See `man git-init` for details. We should be able to rely on pushing and pulling from the default branch without explicitly setting "master", or anything else. dstask will simply push and pull from the remote named "origin" using whatever default tracking branch is set. Refs naggie#116
It is possible to specify an alternative default initial branch for git repositories. This is globally configurable with **init.defaultBranch**. See `man git-init` for details. We should be able to rely on pushing and pulling from the default branch without explicitly setting "master", or anything else. dstask will simply push and pull from the remote named "origin" using whatever default tracking branch is set. Refs naggie#116
We should be able to rely on pushing and pulling from the default branch without explicitly setting "master", or anything else. dstask will simply push and pull from the remote named "origin" using whatever default tracking branch is set. In git 2.32, it's possible to specify the default initial branch for git repositories. This is globally configurable with **init.defaultBranch**. See `man git-init` for details. Refs naggie#116
We should be able to rely on pushing and pulling from the default branch without explicitly setting "master", or anything else. dstask will simply push and pull from the remote named "origin" using whatever default tracking branch is set. In git 2.32, it's possible to specify the default initial branch for git repositories. This is globally configurable with **init.defaultBranch**. See `man git-init` for details. Refs naggie#116
We should be able to rely on pushing and pulling from the default branch without explicitly setting "master", or anything else. dstask will simply push and pull from the remote named "origin" using whatever default tracking branch is set. In git 2.32, it's possible to specify the default initial branch for git repositories. This is globally configurable with **init.defaultBranch**. See `man git-init` for details. Refs naggie#116
We should be able to rely on pushing and pulling from the default branch without explicitly setting "master", or anything else. dstask will simply push and pull from the remote named "origin" using whatever default tracking branch is set. In git 2.32, it's possible to specify the default initial branch for git repositories. This is globally configurable with **init.defaultBranch**. See `man git-init` for details. Refs naggie#116
We should be able to rely on pushing and pulling from the default branch without explicitly setting "master", or anything else. dstask will simply push and pull from the remote named "origin" using whatever default tracking branch is set. In git 2.32, it's possible to specify the default initial branch for git repositories. This is globally configurable with **init.defaultBranch**. See `man git-init` for details. Refs naggie#116
@kevindkeogh I spoke to naggie and we're taking a different approach. We will ask users to set a This is just a heads up. See the associated PR if you're interested. |
Is there a smarter way, where you can query the default upstream branch via git? |
Hm... maybe! According to Git's "Remote Branches" documentation, it appears as you could retrieve the remote branches via If one would change branch, then one would probably expect the tasks to be pushed on that branch..? 🤔 |
It has been a while since I've thought about this issue, specifically. However, I've spent quite a few hours writing automation around git for various day jobs, and my inuition is that there isn't a robust way to do this without adding extra config. Git is fundamentally distributed, and I think there will always be some failure modes if we are to rely on |
I suppose we could list origin remote branches as @adamsoderstrom says and if the list contains Or, require an upstream tracking branch to be configured for the current branch, and push/pull from that implicitly |
What is the state of this? I attempted to assign 'DSTASK_BRANCH=main' with bash without success with v0.26. Gave up and create a new branch, master, set it as default, protected it, and deleted the main branch. I am using gitlab.com which moved from "master" to "main" due to the former being offensive, apparently. Silliness! Everything worked after my changes. |
I think there's a way we can automatically detect the branch as detailed above. It's just not implemented yet. |
Understood and thank you for the update. |
Could we use init.defaultBranch here? In that case, we can fetch the default branch name by Or, do something like they do in the fish git plugin: https://github.com/jhillyerd/plugin-git/blob/master/functions/__git.default_branch.fish |
Hi all,
Great tool. I typically use
main
as my main git branch name, and noticed thatmaster
is hardcoded in thedstask sync
command. Was wondering if it was possible to make the branch name configurable?dstask/git.go
Line 95 in 05f55e1
Thank you!
The text was updated successfully, but these errors were encountered: