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

**URL:** <https://travis-ci.community/t/got-to-fail-carthage-outdated-command-because-of-git-protocol-version/2359>\
**Category:** macOS\
**Created:** [February 19, 2019, 6:55am UTC](https://travis-ci.community/t/got-to-fail-carthage-outdated-command-because-of-git-protocol-version/2359 "2019-02-19T06:55:19Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![torufuruya](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/torufuruya/32/1235_2.png) [@torufuruya](https://travis-ci.community/u/torufuruya)\
**Post date:** [February 19, 2019, 6:55am UTC](https://travis-ci.community/t/got-to-fail-carthage-outdated-command-because-of-git-protocol-version/2359/1 "2019-02-19T06:55:19Z")

</div>

My environment is as follows:

```auto
language: objective-c
osx_image: xcode10.1

```

### ~/Library/Logs/scan/MyApp.log

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

```auto
/bin/sh -c /Users/travis/Library/Developer/Xcode/DerivedData/MyApp-bhautcgmwfkvfigchtwqqwjosuwi/Build/Intermediates.noindex/MyApp.build/Staging-iphonesimulator/MyApp.build/Script-FD5D11F2208D6019001687FC.sh
*** Fetching TagListView
A shell task (/usr/bin/env git fetch --prune --quiet https://b4dbac396898493bdaa671908a266a0e13e3567b@github.com/ElaWorkshop/TagListView.git 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

```auto
Traviss-Mac-6:myapp travis$ git config --global -l
protocol.version=2

```

### Git version

```auto
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.

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [February 19, 2019, 6:21pm UTC](https://travis-ci.community/t/got-to-fail-carthage-outdated-command-because-of-git-protocol-version/2359/2 "2019-02-19T18:21:49Z")

</div>

This is a recent change.

> <https://github.com/travis-ci/travis-build/pull/1659>

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

Thanks.

---

<div class="post-metadata">

**Author:** ![torufuruya](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/torufuruya/32/1235_2.png) [@torufuruya](https://travis-ci.community/u/torufuruya)\
**Post date:** [February 20, 2019, 1:03am UTC](https://travis-ci.community/t/got-to-fail-carthage-outdated-command-because-of-git-protocol-version/2359/3 "2019-02-20T01:03:05Z")

</div>

Thank you for the quick response. This is the build log.  
[https://api.travis-ci.com/v3/job/178463989/log.txt](https://api.travis-ci.com/v3/job/178463989/log.txt)

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [February 20, 2019, 2:14am UTC](https://travis-ci.community/t/got-to-fail-carthage-outdated-command-because-of-git-protocol-version/2359/4 "2019-02-20T02:14:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![torufuruya](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/torufuruya/32/1235_2.png) [@torufuruya](https://travis-ci.community/u/torufuruya)\
**Post date:** [February 20, 2019, 6:23am UTC](https://travis-ci.community/t/got-to-fail-carthage-outdated-command-because-of-git-protocol-version/2359/5 "2019-02-20T06:23:14Z")

</div>

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/*`

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [February 20, 2019, 1:47pm UTC](https://travis-ci.community/t/got-to-fail-carthage-outdated-command-because-of-git-protocol-version/2359/6 "2019-02-20T13:47:32Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![torufuruya](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/torufuruya/32/1235_2.png) [@torufuruya](https://travis-ci.community/u/torufuruya)\
**Post date:** [February 21, 2019, 5:08am UTC](https://travis-ci.community/t/got-to-fail-carthage-outdated-command-because-of-git-protocol-version/2359/7 "2019-02-21T05:08:24Z")

</div>

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.

> <https://github.com/Carthage/Carthage/blob/0c4c64916f9505fd7fbcded6001e83915c572ecf/Source/CarthageKit/Git.swift#L54>

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

```auto
export PATH=
/Applications/Xcode-10.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
/Applications/Xcode-10.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/bin
/Applications/Xcode-10.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec
/Applications/Xcode-10.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/bin
/Applications/Xcode-10.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/local/bin
/Applications/Xcode-10.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin
/Applications/Xcode-10.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/local/bin
/Applications/Xcode-10.1.app/Contents/Developer/usr/bin
/Applications/Xcode-10.1.app/Contents/Developer/usr/local/bin
/Users/travis/.rvm/gems/ruby-2.4.5/bin
/Users/travis/.rvm/gems/ruby-2.4.5@global/bin
/Users/travis/.rvm/rubies/ruby-2.4.5/bin
/Users/travis/.rvm/bin
/Users/travis/.nvm/versions/node/v10.13.0/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/opt/X11/bin
/Users/travis/bin
/Users/travis/.local/bin
/Users/travis/.debug

```

And I found more prioritized `git` executable in `/Applications/Xcode-10.1.app/Contents/Developer/usr/bin/git`

Besides, that `git` version is **2.17.2**.

```auto
Traviss-Mac-6:paidy-ios-app travis$ /Applications/Xcode-10.1.app/Contents/Developer/usr/bin/git --version
git version 2.17.2 (Apple Git-113)

```

In conclusion, Carthage just uses any `git` executable and it’ll be `/Applications/Xcode-10.1.app/Contents/Developer/usr/bin/git` which has unexpected version in Travis.

@BanzaiMan What do you think?

---

<div class="post-metadata">

**Author:** ![dominic](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/dominic/32/14_2.png) [@dominic](https://travis-ci.community/u/dominic)\
**Post date:** [February 21, 2019, 5:46am UTC](https://travis-ci.community/t/got-to-fail-carthage-outdated-command-because-of-git-protocol-version/2359/8 "2019-02-21T05:46:17Z")

</div>

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?

Thanks!

---

<div class="post-metadata">

**Author:** ![torufuruya](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/torufuruya/32/1235_2.png) [@torufuruya](https://travis-ci.community/u/torufuruya)\
**Post date:** [February 21, 2019, 7:37am UTC](https://travis-ci.community/t/got-to-fail-carthage-outdated-command-because-of-git-protocol-version/2359/9 "2019-02-21T07:37:51Z")

</div>

It’s working now. Thanks!

---

<div class="post-metadata">

**Author:** ![dominic](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/dominic/32/14_2.png) [@dominic](https://travis-ci.community/u/dominic)\
**Post date:** [February 21, 2019, 2:00pm UTC](https://travis-ci.community/t/got-to-fail-carthage-outdated-command-because-of-git-protocol-version/2359/10 "2019-02-21T14:00:46Z")

</div>

Glad to hear it and sorry again for the disruption!

---

<div class="post-metadata">

**Author:** ![dominic](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/dominic/32/14_2.png) [@dominic](https://travis-ci.community/u/dominic)\
**Post date:** [February 21, 2019, 2:00pm UTC](https://travis-ci.community/t/got-to-fail-carthage-outdated-command-because-of-git-protocol-version/2359/11 "2019-02-21T14:00:52Z")

</div>


