Editing a file on GitHub then pulling it in Xcode

Discussion in 'iOS Programming' started by patent10021, Jul 28, 2015.

  1. patent10021 macrumors 68030


    Apr 23, 2004
    I only have one problem with Git and that is when I'm modifying a file on GitHub then trying to pull those changes in Xcode Source Control.

    For example, I edit a README.md and commit it on GitHub.com. In Xcode I then obviously want to pull those changes so they will be reflected in my local repo i.e. I want my local README.md to inherit those new changes.

    But every time I modify something on GitHub.com then try to pull those changes in Xcode, I get a "you have uncommitted changes, try committing then pulling" error message.

    So I commit and push and sometimes end up with a branch problem (even though I'm on the same branch) or I'll have to go into the GitHub Mac app and make a commit with the same changes but using a different comment then sync then go back into Xcode and I can then make the pull.

    It's very very strange. What am I doing wrong?
  2. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    Learn to love git stash. It's for those times when you want your workspace to be clean but you're not ready to commit some changes. Unfortunately Xcode doesn't support stash directly; you need to use it from the Terminal.

    git help stash
  3. patent10021 thread starter macrumors 68030


    Apr 23, 2004
    The command saves your local modifications away and reverts the working directory to match the HEAD commit."

    HEAD cause problems with branches so this should be useful. Will check it out. Thanks
  4. moonman239 macrumors 68000

    Mar 27, 2009
    Funny. I was just having my own little wrestle with Git. I suggest using GitHub Desktop - working with GitHub via plain Git can be darn frustrating sometimes.

Share This Page