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
{{ message }}
Repository navigation
Branch switching UX is confusing sometimes when 'bring my changes' and .gitignored files #17883
It's also pretty confusing when on one branch I have some files .gitignored, switch to a branch that doesn't have them ignored, then switch back, and get shown this dialog:
I would assume the correct choice out of those should be 'Bring my changes'; but then when I get back to my branch with the .gitignore, all of these files are suddenly visible in the GitHub Desktop UI, and a bunch of unexpected conflicts/etc.
I believe this is because when switching the branch like this, GitHub Desktop stages everything; which is kind of unexpected, and definitely not desirable.
If I then do a git reset on command line, the view in GitHub Desktop looks far more normal/expected; with seemingly the only remaining issues being the files that had previously conflicted (as I now have to remove the conflict syntax), and any actual remaining differences.
I would assume the correct choice out of those should be 'Bring my changes'; but then when I get back to my branch with the .gitignore, all of these files are suddenly visible in the GitHub Desktop UI, and a bunch of unexpected conflicts/etc.
I'm unable to reproduce this. When you "bring your changes" what we do is we stash all uncommitted changes, switch branch, and pop that stash. Assuming you haven't made changes to these ignored files I don't see how they could create conflicts. Can you provide more detailed reproduction steps?
Thank you for your issue!
We haven’t gotten a response to our questions above. With only the information that is currently in the issue, we don’t have enough information to take action. We’re going to close this but don’t hesitate to reach out if you have or find the answers we need. If you answer our questions above, this issue will automatically reopen.
I still need to get back to testing this fully, but I just noticed something today that might explain it.
On the CLI, if I do git stash push -u, and those changes include .gitignore, then the previously ignored files are now visible, and I would have to do another git stash push -u to actually stash them.
My guess is that a similar thing is happening here with the branch switching.
Activity
niik commentedon Dec 20, 2023
Hey @0xdevalias, thanks for reaching out.
I'm unable to reproduce this. When you "bring your changes" what we do is we stash all uncommitted changes, switch branch, and pop that stash. Assuming you haven't made changes to these ignored files I don't see how they could create conflicts. Can you provide more detailed reproduction steps?
github-actions commentedon Dec 27, 2023
Thank you for your issue!
We haven’t gotten a response to our questions above. With only the information that is currently in the issue, we don’t have enough information to take action. We’re going to close this but don’t hesitate to reach out if you have or find the answers we need. If you answer our questions above, this issue will automatically reopen.
0xdevalias commentedon Jan 5, 2024
I still need to get back to testing this fully, but I just noticed something today that might explain it.
On the CLI, if I do
git stash push -u, and those changes include.gitignore, then the previously ignored files are now visible, and I would have to do anothergit stash push -uto actually stash them.My guess is that a similar thing is happening here with the branch switching.
Leave stashed new files untracked after a restore