Comments (3)
It's quite common for people (self included) to checkout some commit (detached head) or branch (named head) and do some investigation resulting in changes that later they want to be a new branch.
Unfortunately there is a bit of a conceptual merry-go-round (with web questions to match) about which commands to use to update the current head to the users chosen new name, and retain the current changes to the working tree. (Clue it's not the
branch
command).
I'm not 100% sure I understand you here. I assume you mean that git checkout -b new_name
is the right way to go about it, and not git branch new_branch
. Beginners might think the latter is the right one and might get confused. Am I on the right track?
It's not clear in the GUI which of the branch commands (branch>>create, or branch>>checkout) should be used to achieve this oft required action.
Can we improve the GUI menu scheme and dialog boxes to make the correct action clearer (esp if the user is on the wrong track)?
I haven't investigated the code yet to see which is the right gui option, but the menus didn't help.
When I open branch -> create
, I see there is a checkbox at the bottom with the label "Checkout after creation". That should do what you want. So the feature is clearly there. But I see that this is quite the opposite of what the command line Git does. There, "checkout" is used to do this, and here "branch" is used to do this. So are you suggesting that the checkout dialog get a new "create a branch when checking out" option?
I haven't taken a look at the code to see how easy/difficult it would be. FWIW I'm not entirely sure if we should duplicate the feature in two places.
from git-gui.
It's quite common for people (self included) to checkout some commit (detached head) or branch (named head) and do some investigation resulting in changes that later they want to be a new branch.
Unfortunately there is a bit of a conceptual merry-go-round (with web questions to match) about which commands to use to update the current head to the users chosen new name, and retain the current changes to the working tree. (Clue it's not thebranch
command).I'm not 100% sure I understand you here. I assume you mean that
git checkout -b new_name
is the right way to go about it, and notgit branch new_branch
. Beginners might think the latter is the right one and might get confused. Am I on the right track?
Correct. The user wants to create a new branch, keeping the current workspace code intact - they already have the code they want 'checked out' and don't want git to change any of their files, just the HEAD and branch pointers.
In my case I was on a detached head and had tried out a few things then thought "this is worth saving, I'll need a branch.."
It's not clear in the GUI which of the branch commands (branch>>create, or branch>>checkout) should be used to achieve this oft required action.
Can we improve the GUI menu scheme and dialog boxes to make the correct action clearer (esp if the user is on the wrong track)?
I haven't investigated the code yet to see which is the right gui option, but the menus didn't help.When I open
branch -> create
, I see there is a checkbox at the bottom with the label "Checkout after creation". That should do what you want.
hopefully.. (not tried). But usually most cli commands end up saying to stash current changes which isn't what
So the feature is clearly there. But I see that this is quite the opposite of what the command line Git does. There, "checkout" is used to do this, and here "branch" is used to do this. So are you suggesting that the checkout dialog get a new "create a branch when checking out" option?
Assuming that dialog actually does the business, the main issue, for me, is that the dialog text isn't clear enough about what it does (i.e. that no changes will be made to working files!).
If the dialog does some other command (I'm still to look at the code), then again add a few clarifying words as to what happens to file changes.
I haven't taken a look at the code to see how easy/difficult it would be. FWIW I'm not entirely sure if we should duplicate the feature in two places.
Maybe, assuming 'duplication', then it's simply a dialog that tells the user to look at the checkout menu option, and not the branch menu option!
from git-gui.
Ok, I'll take a look when I get the chance
from git-gui.
Related Issues (20)
- "Stage Hunk/Line For Commit" grayed out when having a custom diff
- Does not respect core.hooksPath HOT 3
- Does not respect push.default HOT 5
- "Official" Dark Mode for Git GUI HOT 22
- git-gui doesn't cleanup commit message (strip comments and blank lines) like git-commit HOT 2
- Wrong character encoding in push window
- Prevent TrojanSourceInjection in gitk HOT 3
- hooks are ignored in git worktrees other than the main worktree HOT 1
- Not working - black window HOT 1
- Can the "push" button optionally be removed/disabled/hidden ? HOT 9
- 'git gui' doesn't work in pair with 'git submodule foreach'
- How to make it into a proper mac app? HOT 2
- git-gui crash under macos 13 beta HOT 2
- Compress dialog popping up every time the repo is opened HOT 4
- On the Windows context menu the Target is empty
- Xlib error on console
- Please make diff colors configurable
- there used to be a way to find out keyboard shortcuts. HOT 1
- prepare-commit-msg hook fails because the commit message file does not exist
- Explore Working Copy can't find explorer.exe
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-gui.