I have to type branch name twice when switch/checkout fails
What steps will reproduce the problem?
- Have local changes
- Use Switch/Checkout to try to create a new branch and switch to it
- Get an error:
git.exe checkout --no-track -b JIRA-1726-explanation-in-branch-name remotes/origin/master --
error: Your local changes to the following files would be overwritten by checkout: folder/folder/filename.cpp Please commit your changes or stash them before you switch branches. Aborting
git did not exit cleanly (exit code 1)
- Stash my changes manually, or commit them to my current branch
- Try to switch to the new branch again
- The branch is not there
- You must type the branch name again and create the branch again
What is the expected output? What do you see instead?
I would prefer the branch to be created, but just the switching to fail. That would mean I wouldnt need to type the branch name in again.
Why is typing the branch name a big deal? Because we use JIRA ticket numbers in our branch names, so I have to switch back to JIRA again to find out what the number is, and often we use descriptive branch names and think about what to call them. I need to go through this thinking process again to name the branch, this is a bit annoying.
I realise this is probably because the git call is a single-step call. If so, how about switching to a 2 step call?
- Create the branch
- Try to switch to it
Alternatively, can TortoiseGit remember the branch name when I try to recreate the branch in the same place 5 minutes later? Or maybe something helpful in the 'retry' dropdown?
What version of TortoiseGit and Git are you using? On what operating system?
Please provide any additional information below.