Skip to content

Swapping branches with changes #8200

Closed

Description

@christopherparo

Description

Wanted to bring uncommitted changes over to a new branch but instead just lost everything.

Version

  • GitHub Desktop: 2.1.3
  • Operating system: macOS Mojave 10.14.6

Steps to Reproduce

Doesn't happen all the time but...

  1. Make changes in one branch
  2. Change to new branch
  3. When prompted to stash changes or bring over choose bring over choose bring over
  4. You will see no new changes on the new branch and when you check old branch no stashed changes are there

Expected Behavior

I expected my changes to be in the new branch

Actual Behavior

They were erased

Additional Information

Logs

2019-09-03.desktop.production.log

Activity

  1. tierninho commented on Sep 4, 2019

    @tierninho
    Contributor

    @christopherparo Thanks for filing the issue. Your files should not be lost, but stashed on the original branch. Do you see in merge conflicts? Please resolve them to continue your work.

    Should look something like this:

    Screen Shot 2019-09-03 at 2 37 56 PM

    To verify if there is a stash or a merge conflict on a branch, try opening the branch in terminal and typing: git stash and git status. Let me know.

    Errors in your logs:

    2019-09-03T20:33:08.844Z - error: [ui] `git -c credential.helper= -c protocol.version=2 checkout --progress origin/cms -b cms --` exited with an unexpected code: 1.
    stderr:
    error: Your local changes to the following files would be overwritten by checkout:
    	package-lock.json
    	src/app/containers/cms/index.tsx
    	src/app/root.tsx
    Please commit your changes or stash them before you switch branches.
    error: The following untracked working tree files would be overwritten by checkout:
    	src/app/containers/cms/CmsInitModal/DomainForm.tsx
    	src/app/containers/cms/CmsInitModal/DomainType.tsx
    	src/app/containers/cms/CmsInitModal/index.tsx
    Please move or remove them before you switch branches.
    Aborting
    
    (The error was parsed as 37: Unable to switch branches as there are working directory changes which would be overwritten. Please commit or stash your changes.)
    

    It also sounds like this is related to this pending fix: #8084

  2. added
    more-info-needed
    on Sep 4, 2019
  3. tierninho commented on Sep 12, 2019

    @tierninho
    Contributor

    Closing this out as a possible fix is in progress and also due to inactivity. Please follow along on issue #8084

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    more-info-needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions