Xcode: “The working copy ____ has uncommitted changes” vs. git status: “nothing to commit, working directory clean”

前端 未结 4 1830
无人及你
无人及你 2021-01-31 16:57

In Xcode 5.0.2, I try to pull from a remote and am given the following message:

\"The working copy \'project-name\' has uncommitted changes. Commit or discard the change

相关标签:
4条回答
  • 2021-01-31 17:25

    Okay, so I fixed my issue.

    With Xcode open:

    1. Open terminal - cd / to your project directory.
    2. Type in: "git reset --hard"
    3. Type in git status

    Restart Xcode and make a commit (Just a comment or something )

    Repeat the above steps.

    This sorted out my issue for me.

    0 讨论(0)
  • 2021-01-31 17:28

    You must fix it with command line git. Go to your working folder in Terminal, type:

    git status
    

    That will show you what files have uncommitted changes. Crashlytics, for instance, will update itself as soon as you run it, and even using Xcode/Source Control/Discard Changes won't get rid of it.

    Once you see the files that have uncommitted changes (ignore added files), use:

    git checkout -- Folder/filename.ext
    

    That's the same as a "discard" in Xcode.

    After you've done that, go back to Xcode and you should be able to switch branches.

    0 讨论(0)
  • 2021-01-31 17:33

    App Code solution:

    1. Confirm git status in Terminal:

      git status

    2. Open 'yourProject.xcworkspace' in App Code

    3. VCS > Git > Branches...

    4. Remote Branches > yourBranch > Checkout as new local branch

    5. Confirm fix via Terminal:

      git status

    0 讨论(0)
  • 2021-01-31 17:47

    xCode is really-really crappy. Everytime you just look at files, a file called UserInterfaceState.xcuserstate is changed. You don't see it in the overview of xCode itself, through the command line you can.

    Quick fix:

    1. Open Terminal
    2. CD to your project directory, and type the following:
    3. git add .
    4. git commit -m "Commit"
    5. git push origin master
    0 讨论(0)
提交回复
热议问题