🆕 Create a branch for an issue in public beta · community · Discussion #12290 (original) (raw)
this is nice. but i would prefer like gitlab has it, that it creates both a branch and a PR for you. one of the things that annoys me a lot when working on github. i like to take notes about my work in the PR but on github i can't do that before i already have 1 commit on the branch, something which doesn't always happen so fast.
You must be logged in to vote
9 replies
I am in need of the V1.2 source codes to help fix a major error in all versions after 1.2. Please email to ( w3l01@aol.com ). I need the developers and editor version of the software to do a step by step debug of how the software handles math.. Thanks in advance and do not cancel this request.
@dipree Yup, that's the missing piece. While the feature itself is nice, the inability to draft a PR on a "no difference" compare i. e. on the prepared empty branch makes its utilisation way less useful. — Having the ability to draft a PR, i. e. start jotting down the outline and task lists, having prepared an empty branch for it at the same time, and linking both to the original issue is IMHO the ideal workflow that should be enabled in the future.
The need for a description (a brief, an outline, or an action plan; content like this) usually predates the first commit.
shouldn't be the issue discussion the right place where you can define how to implement it?
@BellettiR Usually issue tracks symptoms/repro, impact, deps… while PR describes reasoning/rationale, implementation, tests, and overall progress. Our workflow usually has input and prep for new branch/feature/PR before anyone touches the first line of code — exactly what this new branch functionality is for, just missing the ability to open a (draft) PR for this new empty branch right away.
This comment was marked as off-topic.
It would be pretty awesome if it were possible to link an existing branch from another repository within the scope of the organization.
Where I work there is a certain repository of tasks where it is not possible to link Pull Requests or Branches because the projects are done in another repository, this would be an excellent addition.
You must be logged in to vote
7 replies
We have the same challenge as @devnatan - @dipree your suggestion, while interesting, means now 2 branches need to be tracked, merged, and cleaned up.
I was just thinking about the same thing. I think this functionality would make the feature a lot more useful.
We are currently looking into the linking of existing branches from within an issue. I'll keep you posted.
@dipree Glad to hear this is something being investigated. I would like to throw my own 2 cents in here and say that when I create a branch called issue-2 from my git CLI, I would love if github could automatically match that to the related issue, rather than me having to go in and manually look it up on the issue and join them together.
think other platforms seems to be way ahead in this, remembered i could intuitively link existing branches quite easily.
Just noticed that when I do create a PR from the branch, it automatically links it to the issue and marks the issue for autoclosing when the PR is merged. This is something we don't want in our org so this is a bit annoying. E.g. we already have to write "for #123" in PRs instead of "fixes #123" to avoid the autoclosing, and this adds another thing we have to dodge.
You must be logged in to vote
5 replies
Again, good feedback, keep it coming. This is not directly related but I will make sure to pass it on.
Now that I have been using it for a while I agree this is way too much almost hidden automation I can't control. I am unlinking the issue on the PR just before merge to stop it from auto closing the issue. Maybe options on the PR merge page on how you want to deal with linked issues?
I do like the current behaviour so an option to choose would be fantastic
I totally agree because currently there are some other tests and other steps that needed to happen between when the main issue's branch's PR is closed and when the issue is closed. Right now there seems to be no way to adjust/modify this behavior at the moment.
Finally! That's exactly the feature I've been waiting for - thanks for adding this to GitHub.
One small issue: when the issue title contains special characters (e.g., markdown backticks), it would be amazing if branch name could sanitize those out.
You must be logged in to vote
9 replies
@dipree the sanitization should be based on a whitelist (list of allowed characters, disallow everything else) not a blacklist (list of disallowed characters, allow everything else). I hope by now it is. :)
We have a similiar problem. If the issue title contains diacritics, the branch will then contain diacritics. We want to keep diacritics in the issue title but have the branch name sanitized.
Not within the scope of this feature currently, but in the future it would be neat to see:
- The existence of any branches associated with the issue appear in the main "Issues" page, similar to how the PR icon shows up. This would help to differentiate between active and inactive issues (similar to Azure Devops)
- The creation of a development branch show up in the timeline of a specific issue, similar to other events (commits, comments, tags, etc.)
Great work guys
You must be logged in to vote
0 replies
I can't assign existing branch (new-design) to the issue: TomaszGasior/RadioLista-v3#116. It's only possible to create branches and choose PRs, no way to just select existing bare branch.
You must be logged in to vote
0 replies
It would be great if we can configure some sort f regex when it comes to the naming convention of the branch as well as limit or unlimit the name length of the branch
For example.
bug/issue-name/123
or to kind of generalise that[label]/name/[ticket number]
You must be logged in to vote
18 replies
It's been 2 years now, is this possible? Is there anyone working on it?
Yes! I came to to suggest exactly the same thing! I can't find any documentation suggesting it was every implemented :-( Please GitHub! We have very particular naming conventions for our repo and right now it is a pain to delete the long suggested option and then manually enter our version. It is a very specific pattern so would be easy to configure if such an option existed :-(
Would still love this feature
This would be an amazing feature
Can we have an update? Is anyone working on this feature? Basically we need the ability to setup a branch name naming template.
Could we get the option to move a projects story to the correct column when using the create branch feature?
A story/issue is in the Todo column. Once the branch is created the story is then moved to the "In Progress" column.
You must be logged in to vote
1 reply
That's indeed a great suggestion. This currently limited by the Projects Beta which doesn't allow this yet. But once it does we can support this is an option.
We'd like to see the ability to configure a default repository destination.
We've got a two-repo structure for all projects to separate project management and source*.
So for a ticket in the foo-project repo, branches will always be in the foo-source repo. Now we can use the dropdown, but making it configurable will avoid occurences of distractingly creating it in the wrong repo, and just reduce the number of clicks we have to do every time.
On a related note, being able to configure the default branch would also be nice.
Something a bit more complex: configuring the default branch source (and branch name) based on labels.
Examples:
- a
hotfixlabel means a branch namedhotfix/1234-broken-thingoff themainbranch. - a
featurelabel means a branch namedfeature/5678-awesome-new-thingcreated off thenightlybranch.
You must be logged in to vote
1 reply
If not by label, then at-least multiple branch name templates with a title that becomes a button in the modal
Love the feature! But I think I ran into a bug?
My issue title is something like "🐛 [Foo] Bar" which suggests a branch name 42-🐛-foo-bar. Which works. But after checking out the branch locally, I'm not able to push, it fails without any helpful error message
You must be logged in to vote
1 reply
We are now sanitizing the branch name more strictly so this shouldn't happen anymore.
This is amazing, it working very good! But have a stranger behavior, when have " - " in name of issue, type "Product - Create Variants", in name of branch get 3 "-", type "52-produtos---create-variants"
You must be logged in to vote
1 reply
Thanks for the feedback, this has been fixed.
Linking to an existing branch would be great.
You must be logged in to vote
2 replies
You can link an existing branch from here
That links an existing PR, not a branch
I like this feature, and it would be better if we can add the feature type to the branch name like <ref>-<type>-<issue name> instead of <ref>-<issue name> the type could be a value like feat/bug/docs/...
You must be logged in to vote
0 replies
You must be logged in to vote
1 reply
Huge +1 on the configuration of the default source branch used for this modal.
✔ fixed
Default branch name should include numbers from issue title
Default branch name is currently in format of issuenum-words-from-issue-title e.g. 123-client-fix-broken-grapple
But in this example, the original issue title is Client 12 fix broken grapple. the devs are now always editing the branch name to add the client number.
The branch name they want is 123-client-12-fix-broken-grapple
Can we get number as allowed character in default branch name please?
We have the same problem with both client numbers and report numbers being omitted.
You must be logged in to vote
2 replies
default branch name should be customizable! let's try not to make the same mistake as in gitlab ce :)
Can we get number as allowed character in default branch name please?
@700software we just deployed a fix for that this morning, thanks for bringing it up!
Add a "Open branch with VS Code".
You must be logged in to vote
0 replies
Please consider placing the "Create branch" button on the same pop-up pane as the rest of the dialog, to make it a bit easier to find and use. The current placement, as shown below, does not feel as intuitive, IMHO. Thank you.
(Apologies if I missed something; I'm pretty new to git and GitHub.)
You must be logged in to vote
2 replies
It doesn't look like that for me. The button is inside the white box, not floating outside. Have you tried reloading the page?
Yes, and it's reproduceable. But I figured out what's happening. The white pane box is avoiding the bottom edge of the browser window, but the Beta/Share/Create elements do not. When I change the Zoom level, or alternatively the size of the browser window, the white pane box adjusts accordingly.
I have applied a rule set to the branch names and now I get the following error when creating a new branch via this feature:
Sorry, there was an error creating the branch.
the rule is: ^\d+\/[a-zA-Z_]+-[a-zA-Z.]+$ which is matching the provided name 12/bug_foo-markus.falk
Any ideas?
Thank you!
You must be logged in to vote
0 replies
It would also be nice if the default branch name already used "folders" (/) for the branch name issue number:
- 1/foo
- 1/bar
- 2/foo
A lot of tools support this to give more oversight and group things together
You must be logged in to vote
0 replies
Two things:
One: Seriously, please remember the "What's next" setting. Makes no sense I need to fill it in every other day.
Two: Remove the issue number prefix, it adds no value IMHO.
You must be logged in to vote
2 replies
Remove the issue number prefix
Why? It is a good identifier useful for quickly identifying the issue the branch should fix.
For me it adds no value, GitHub already tracks the issue/branch connection, so I don't personally see the need for it.
Need a Default Branch
Hey there,
I'd love to see a more streamlined way to choose the default branch when creating a new branch. It would be awesome if I could set my preferred branch (like dev) as the default.
Right now, I always branch from dev, and other dev team member do so as well. Since merging into main is a separate DevOps task, it would make things smoother for developers if we could customize our default branch.
Share if you have any thoughts on this!
You must be logged in to vote
2 replies
Seems to me like dev ought to be your default branch for the whole repo, not just this feature. It sounds like main as default doesn't serve your needs. Genuinely curious if you see it differently though.
It's not unusual for larger projects to have a flow where they have a main branch that holds code that's closer to release ready, then a dev branch for features. This allows for a few tricks, like merging higher priority fixes into the main branch ahead of features that may require other features or other tweaks.
Given how many Github and Git features rely on the default branch (That's the one that gets tagged for releases, the one that gets packaged and attached, etc.), I can see why changing the default branch to Dev may not be desirable.
I prefer if we can add a default branch name, because when someone at job wanna create a branch to resolve an issue, they sometimes use the default name instead of use the regular names we used like "fix/this-layout'" or "feat/this-function".
i know it's an human error but i'd like if i can create a prefix for this issue in particular, something like take it from the label.
for example, this issue has the label bug. then the prefix should be always "fix/", this other has the label feature, then has the prefix "feature/" so we can reduce this error by a lot
You must be logged in to vote
1 reply
Issues can have multiple labels. How would they decide which label to choose?
What you’re looking for could work well with the issue types beta though.
This feature is one of the best changes I’ve ever seen on GitHub. We have a requirement that every merge to main is a PR, and there are occasionally small issues where naming the branch could be the longest part of the work of closing the issue. In our org, branch naming is a meaningless thing to spend effort on, and this lets us invest more of our energy in more productive endeavors.
You must be logged in to vote
2 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
I've been extremely happy with this new feature, which starts to address a massive capability gap in GitHub generally. Creating a new issue and then creating a branch off of that issue is a use case I've wanted for years. It's much easier than to do this on the command line, which I've done for years only to get many of my branches and PRs polluted with other completely unrelated files and commits from other devs.
I've exercised this feature well over a dozen times without any fuss. I've had much better luck locking my PRs away from other prying Git users then I've ever had before. I like a clean PR, and finally I get to have them more often than not with this feature. I've also found that instead of using often traumatic Git Rebase operations when it DOES happen, a simple Git Reset HEAD~1 usually takes care of the matter.
Keep up the good work!
You must be logged in to vote
0 replies
Please align error-messages for rules with branch-creation
Hi,
we have a "match regex" branch naming rule.
When we "normally" create a new branch, which does not match that rule we get nice error message:
When creating a new branch from an issue there is just a generic "Sorry, there was an error creating the branch." instead of that nice message from the first case.
You must be logged in to vote
1 reply
When selecting an alternate branch as the source, the CSS breaks and the button and feedback link overflow. I'm using a small-screen laptop, which may be contributing to this bug.
You must be logged in to vote
0 replies
The branch naming format should be customisable and by default I would say it should contain the GH username, so: <GHhandle>/<issue-number>-sanitized-issue-description.
You must be logged in to vote
0 replies
I see that when merging PRs from Android Studio (Ladybug) the issue isn't closed when the PRs is merged into a another branch. Will this only function when the PRs are merged into master ? So then, I need to close them manually in github web.
You must be logged in to vote
0 replies
Please bring back the loading indicator when clicking "Create branch" -- often times I thought I hadn't click, and had to click again (which then closes the modal sometimes)
You must be logged in to vote
0 replies
It would be really helpful if a branch linked to the original issue also appeared as a linked branch in all duplicate issues.
You must be logged in to vote
0 replies





