• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • None
    • 4.2.9
    • Git
    • None
    • Severity 2 - Major

      The last several hours have seen many developer posts about Xcode failing to resolving SPM packages after users upgraded Sourcetree.

      Xcode fails with this message: 

      fatal: cannot use bare repository... 

      The Sourcetree 4.2.9 upgrade added:

      [safe]
          bareRepository = explicit 

      to 

      ~/.gitconfig

      Removing the added line allows Xcode to work again.

            [SRCTREE-8176] Upgrade Mac 4.2.9 causing Xcode to fail with SPM

            Hi, 830b4bf216cd 
            Thanks for reporting this. 

            We've provided few security fixes recently and one of them is related to safe.bareRepository setting in gitconfig file. You could disable auto-pushing this setting in your config in Sourcetree settings by opening Sourcetree -> Settings... and unchecking "Allow Sourcetree to modify your global Mercurial and Git configuration files". This way Sourcetree will not push this setting on every launch.

            Regarding bareRepository = explicit, I agree that pushing it in such aggressive manner was not a good idea. We will try to think about some other more soft way and implement it. I've already raised internal task for this and we'll work on this to provide fix in the next release.

            Also, for people who searching resolution/workaround for this issue right now, I'm duplicating possible solution.
            To continue working with Package Managers which are requiring bare repositories (like SPM) you need to do the following:

            1. Go to Sourcetree -> Settings... and uncheck "Allow Sourcetree to modify your global Mercurial and Git configuration files". This will prevent Sourcetree from pushing this setting after relaunch.
            2. Open your ~/.gitconfig file and search for entry below:
              [safe]
                  bareRepository = explicit
            3. Remove these two lines from your gitconfig
            4. Save the ~/.gitconfig file.

            Thanks

            Raman Sidarakin (Inactive) added a comment - - edited Hi, 830b4bf216cd   Thanks for reporting this.  We've provided few security fixes recently and one of them is related to safe.bareRepository setting in gitconfig file. You could disable auto-pushing this setting in your config in Sourcetree settings by opening Sourcetree -> Settings... and unchecking "Allow Sourcetree to modify your global Mercurial and Git configuration files". This way Sourcetree will not push this setting on every launch. Regarding bareRepository = explicit, I agree that pushing it in such aggressive manner was not a good idea. We will try to think about some other more soft way and implement it. I've already raised internal task for this and we'll work on this to provide fix in the next release. Also, for people who searching resolution/workaround for this issue right now, I'm duplicating possible solution. To continue working with Package Managers which are requiring bare repositories (like SPM) you need to do the following: Go to Sourcetree -> Settings... and uncheck "Allow Sourcetree to modify your global Mercurial and Git configuration files". This will prevent Sourcetree from pushing this setting after relaunch. Open your ~/.gitconfig file and search for entry below: [safe]     bareRepository = explicit Remove these two lines from your gitconfig Save the ~/.gitconfig file. Thanks

              43c951f935c6 Raman Sidarakin (Inactive)
              830b4bf216cd Erik Holley
              Affected customers:
              6 This affects my team
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: