Not able to start feature branch by selecting commit id option in SourceTree
Asked Answered
P

5

11

I'm working on implementing Git Flow branching strategy in my company and for that I'm testing all possible options which is provided in SourceTree GitFlow.

Two problems I've faced till now:

  1. I'm trying to start a new feature branch by selecting a specified commit with value but its failing with below error sh.exe C:\Users\useraname\AppData\Local\Atlassian\SourceTree\gitflow_local\gitflow\git-flow feature start checkingfeaturebycommit d14c9a9a35d504958e3df6b42db5acfc8466bfd4 Fatal: Base 'd14c9a9a35d504958e3df6b42db5acfc8466bfd4' needs to be a branch. It does not exist and is required. Completed with errors, see above.

  2. what is meaning of second option while starting feature "Working copy parent" because when I tried to start feature by selecting this option, it also failed with same error.

Please help me understand these and let me know if I'm doing anything wrong.

$ git flow release start releasefromcommit 35ec45c01872212ad5f33e068c984def5d18a284
Fatal: Base '35ec45c01872212ad5f33e068c984def5d18a284' needs to be a branch. It does not exist and is required.
Proximal answered 17/11, 2017 at 7:13 Comment(6)
Are you trying to create feature branch from a commit or from a branch?Megaphone
Yes, I'm trying to create feature from commit. I even tried to release branch also from specified commit but got same error.Proximal
Could you give more details? Your commands while trying to create branches and complete errors.Megaphone
I'm using SourceTree GitFlow option but even commands are also giving me same errors.Proximal
Since GitFlow is really just an macro/alias for standard git command, would creating a branch manually work for you? git branch release/releasefromcommit 35ec45c01872212ad5f33e068c984def5d18a284 I don't use SourceTree but this works for me. Then I use the release branch as normal and then git flow release finish releasefromcommit when done.Territerrible
Yes, I also found the same solution and have been using it like that only. Anyways I only need to use this method very rarely, only in extreme case of requirement.Proximal
D
12

Open terminal

git branch release/yourReleaseName 43331988a3b86cc7ece4d323e8ec578c65437e8847

git flow finish yourReleaseName

If you're looking for the long string, you can get it in various ways, one is to open git flow, start release, check from specific commit, select your commit, and copy and paste to notepad, and then if you cant copy and paste it to terminal, you can manually enter it (i had to do it this way)

Good luck (thank Roger for the answer)

Darbies answered 23/5, 2018 at 9:45 Comment(0)
F
13

I'm creating this answer here in case this comes up the next time I run into this. This identical question was asked on Atlassian's site too. The answer there was:

Hello! This appears to be an issue with git-flow where it will not allow commit SHAs to be used when starting a new feature (I'd suggest that you file a bug here. If you'd like to start a new feature from a branch, then I'd recommend just typing the name of the branch into the "Specified commit" box.

(emphasis mine) which worked for me.

Flutterboard answered 31/7, 2018 at 13:33 Comment(1)
Wow! This works for me :) It is not accepting any id but the branch name (e.g. master or type your_branch)Grizelda
D
12

Open terminal

git branch release/yourReleaseName 43331988a3b86cc7ece4d323e8ec578c65437e8847

git flow finish yourReleaseName

If you're looking for the long string, you can get it in various ways, one is to open git flow, start release, check from specific commit, select your commit, and copy and paste to notepad, and then if you cant copy and paste it to terminal, you can manually enter it (i had to do it this way)

Good luck (thank Roger for the answer)

Darbies answered 23/5, 2018 at 9:45 Comment(0)
P
4

This is a bug in SourceTree application and atlassian support team accepted it and disabled these options for hotfix branch in latest release but for other branches. Hopefully they will fix or disable these option for feature and release also, so no one else gets confused.

Bug Link: https://community.atlassian.com/t5/Sourcetree-questions/Not-able-to-start-feature-branch-by-selecting-commit-id-option/qaq-p/674112

Proximal answered 12/4, 2018 at 6:4 Comment(1)
Without a link to the bug, this is not helpful at all.Implosive
S
1

Instead of using Gitflow, you can right click on the branch from which you need the release or feature branch to be created and select branch. If it is feature then feature/[feature name] or if it is release then release/[release name]

Smidgen answered 20/5, 2020 at 7:28 Comment(2)
That does not answer the question.Implosive
@Implosive I got the same error mentioned in the question while using gitflow option of source tree. What I mentioned in my answer is what I did to start a new branch instead of using gitflow option.Smidgen
A
0

As they said above, it's a SourceTree "bug". Using Mac do this via terminal:

If you don't have git-flow cli:

brew install git-flow

git-flow feature start <YOUR-NEW-BRANCHNAME> <COMMITID-FROM>
Apospory answered 1/8, 2023 at 7:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.