You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have any untracked files you cannot switch branches in desktop because this new dialog appears. Previously this was not the case and you could switch branches and carry around untracked files.
Previously this was not the case and you could switch branches and carry around untracked files.
This is now that second option in the list - "Bring my changes to master". If you choose that you'll complete the flow and have your changes available there.
The context behind this new dialog is outlined in more detail in #6107, and we decided that checkout was a good point to ask the user whether they wanted to bring the changes with them, or leave them stashed with their previous branch.
The question is, even if I confirm that changes to be brought to master, when I end up in master, whether these files are considered as potentially part of the changes to be committed? Normal git workflow distinguished between files that have been added, and files that are untracked. This new desktop change merges those two sets and therefore appears to be a regression in desktop.
Also, this is confusing new and additional step because these are not changes. Git does not track these as changes and so why is the user being asked to bring changes [which are not changes] into the new branch?
In my view, these are not files to be considered for version control.
quite unhappy with this new feature as well, switching branches is very annoying right now. Please consider to put a new configuration setting, which removes this extra dialog
This new desktop change merges those two sets and therefore appears to be a regression in desktop.
There's a bunch of extra context here that's unchanged from previous releases, so I'll try and cover it briefly before diving into how this affects this workflow:
GitHub Desktop does not distinguish between untracked files and staged new files in the working directory - both of these are displayed as "New" to the user
While you could stage files outside the app and switch back to Desktop, those staged changes will be unstaged before committing in Desktop to ensure what you've chosen to commit in the app is what gets committed.
These decisions are because we don't want to overload the user with the concept of the Git index, and make the user think about staging files. We want committing to be as simple as possible.
Git does not track these as changes and so why is the user being asked to bring changes [which are not changes] into the new branch?
Untracked files on one branch are not guaranteed to be untracked files on another branch, so being cautious here is how Desktop approaches it. Here's the simplest demo I could think of to illustrate why we need to be aware of untracked files in the working directory:
$ git init test-untracked-filesInitialized empty Git repository in /Users/shiftkey/src/test/test-untracked-files/.git/
$ cd test-untracked-files
$ git commit -m "empty commit" --allow-empty[master (root-commit) 3e95812] empty commit
$ git branch new-branch
$ echo"some file">> README.md
$ git add .
$ git commit -m "created an empty README"[master 2b6971e] created an empty README 1 file changed, 1 insertion(+) create mode 100644 README.md
$ git checkout new-branchSwitched to branch 'new-branch'
$ echo"a different file">> README.md
$ git status --untracked-files=allOn branch new-branchUntracked files: (use "git add <file>..." to include in what will be committed) README.mdnothing added to commit but untracked files present (use "git add" to track)
$ git checkout mastererror: The following untracked working tree files would be overwritten by checkout: README.mdPlease move or remove them before you switch branches.Aborting
With this new flow the dialog becomes really important, because it gives the user the chance to:
"Leave changes" - stash the untracked files with their current branch, checkout the other branch, and context switch to their other task
"Bring changes" - stash the changes, checkout the branch, pop the stash, resolve conflicts, continue working
If we didn't do any work here, and instead ran git checkout we'd still need the user to intervene.
@jmonrove thanks for that input. I want to provide some extra context from your comment in #6107 that I think is overlooked:
You travel to release and merge feature_1 (stash dialog)
You travel to master and merge release (stash dialog if you didn't stash)
You travel back to feature_1 (time to unstash)
This flow was intended to allow you to stash your changes on feature_1 (because that's where you were last working on them). Once those changes are stashed you won't be prompted again until you return to feature_1 and unstash them explicitly.
The goal with this feature was not just to support "magic stashing", but to make it easier to manage your uncommitted changes. Previously those would always be carried around as you switch branches, and potentially interrupt you because Git is very conservative about how to handle these uncommitted changes if conflicts arise. But now you can park them on your current branch and switch to other work without needing to commit or stash them.
I understand, I like to have the option to keep things contained through the desktop application (I used to do it directly from the terminal before by stashing changes). I also agree that it will help to solve those situations where you cannot checkout a different branch because of conflicts, you can just have it stashed and then go there.
Is just that the situation doesn't happen as often as just traveling with your changes ( it's happened probably 4 times in the last year), at least for me.
In my case, the popup fix for a rare occurrence, has turned into the new normal
Activity
shiftkey commentedon Jun 7, 2019
@markp2 thanks for the feedback!
This is now that second option in the list - "Bring my changes to master". If you choose that you'll complete the flow and have your changes available there.
The context behind this new dialog is outlined in more detail in #6107, and we decided that checkout was a good point to ask the user whether they wanted to bring the changes with them, or leave them stashed with their previous branch.
markp2 commentedon Jun 7, 2019
@shiftkey
Thankyou, I see that now.
The question is, even if I confirm that changes to be brought to master, when I end up in master, whether these files are considered as potentially part of the changes to be committed? Normal git workflow distinguished between files that have been added, and files that are untracked. This new desktop change merges those two sets and therefore appears to be a regression in desktop.
Also, this is confusing new and additional step because these are not changes. Git does not track these as changes and so why is the user being asked to bring changes [which are not changes] into the new branch?
In my view, these are not files to be considered for version control.
ChristophRob commentedon Jun 7, 2019
quite unhappy with this new feature as well, switching branches is very annoying right now. Please consider to put a new configuration setting, which removes this extra dialog
shiftkey commentedon Jun 7, 2019
@markp2
There's a bunch of extra context here that's unchanged from previous releases, so I'll try and cover it briefly before diving into how this affects this workflow:
Untracked files on one branch are not guaranteed to be untracked files on another branch, so being cautious here is how Desktop approaches it. Here's the simplest demo I could think of to illustrate why we need to be aware of untracked files in the working directory:
With this new flow the dialog becomes really important, because it gives the user the chance to:
If we didn't do any work here, and instead ran
git checkoutwe'd still need the user to intervene.shiftkey commentedon Jun 10, 2019
@markp2 I'm going to close this out, but let us know if you have any other questions about this area
shiftkey commentedon Jun 10, 2019
@jmonrove thanks for that input. I want to provide some extra context from your comment in #6107 that I think is overlooked:
This flow was intended to allow you to stash your changes on
feature_1(because that's where you were last working on them). Once those changes are stashed you won't be prompted again until you return tofeature_1and unstash them explicitly.The goal with this feature was not just to support "magic stashing", but to make it easier to manage your uncommitted changes. Previously those would always be carried around as you switch branches, and potentially interrupt you because Git is very conservative about how to handle these uncommitted changes if conflicts arise. But now you can park them on your current branch and switch to other work without needing to commit or stash them.
jmonrove commentedon Jun 10, 2019
@shiftkey thanks for the reply!
I understand, I like to have the option to keep things contained through the desktop application (I used to do it directly from the terminal before by stashing changes). I also agree that it will help to solve those situations where you cannot checkout a different branch because of conflicts, you can just have it stashed and then go there.
Is just that the situation doesn't happen as often as just traveling with your changes ( it's happened probably 4 times in the last year), at least for me.
In my case, the popup fix for a rare occurrence, has turned into the new normal