Got to fail carthage outdated command because of git protocol.version

My environment is as follows:

language: objective-c
osx_image: xcode10.1


I’m using fastlane and this is the fastlane scan log.

/bin/sh -c /Users/travis/Library/Developer/Xcode/DerivedData/MyApp-bhautcgmwfkvfigchtwqqwjosuwi/Build/Intermediates.noindex/
*** Fetching TagListView
A shell task (/usr/bin/env git fetch --prune --quiet refs/tags/*:refs/tags/* +refs/heads/*:refs/heads/* (launched in /Users/travis/Library/Caches/org.carthage.CarthageKit/dependencies/TagListView)) failed with exit code 128:
fatal: unknown value for config 'protocol.version': 2

Command PhaseScriptExecution failed with a nonzero exit code

Git config

Traviss-Mac-6:myapp travis$ git config --global -l

Git version

Traviss-Mac-6:myapp travis$ git version
git version 2.19.1

Passed after I changed global git config protocol.version from 2 to 1.

Got to fail these days suddenly and I have no idea what was changed in your environment.

This is a recent change.

When reporting a problem, please include a build log URL, so we can help you better.



Thank you for the quick response. This is the build log.

This job does not have an error message you indicated previously. Could you double check you have the right job?

Yes, the error message I wrote was that I got from the log file while running the debug job.
The log file was some like ~/Library/Logs/scan/*

That is not very helpful, but the likely explanation is this: Your invocation of git is actually one for the system git (as in /usr/bin/git) which is not recent enough to understand the protocol version 2. To wit:

Traviss-Mac-6:travis_production_test travis$ git --version
git version 2.19.1
Traviss-Mac-6:travis_production_test travis$ which git
Traviss-Mac-6:travis_production_test travis$ /usr/bin/git --version
git version 2.17.2 (Apple Git-113)

I don’t know much about Carthage implementation, it seems they just use git to fetch the git repository as far as I glanced at their code.

When Xcode executes run script, environment variables are printed out as below:

export PATH=

And I found more prioritized git executable in /Applications/

Besides, that git version is 2.17.2.

Traviss-Mac-6:paidy-ios-app travis$ /Applications/ --version
git version 2.17.2 (Apple Git-113)

In conclusion, Carthage just uses any git executable and it’ll be /Applications/ which has unexpected version in Travis.

@BanzaiMan What do you think?

Thanks for this insight, @torufuruya!

We’ve reverted the change that enabled Git Wire Protocol v2 so this issue should be fixed now.

Could you confirm by restarting a previously failing build?


It’s working now. Thanks!

Glad to hear it and sorry again for the disruption!