简体   繁体   中英

Xcode and git-lfs

I installed git-lfs using homebrew , and it works fine from the command line. I can still add text files in Xcode as well, but whenever I try in Xcode to add a file which should be tracked by git-lfs , there is no effect (the file stays "?" in Xcode's file list, and the command line confirms that the file was not, in fact, added). After some research, I tried adding ~/Library/LaunchAgents/my.startup.plist to setenv PATH /usr/local/bin but it had no effect.

How can I get Xcode to play nice with git-lfs ?

There seem to be a problem with using git-lfs with Xcode. See this article: http://gopalkri.com/2016/05/17/git-lfs-xcode-asset-catalogs/

Might be better off to stick with Git to commit your changes instead of doing it via Xcode.

We have a similar issue, our CI uses Xcode's git and not the homebrew one. So we needed to get git-lfs working in Xcode. This proved pretty simple: copying the git-lfs core file from the homebrew version into Xcode (you need to do this again every time you upgrade Xcode):

sudo cp /usr/local/Cellar/git/2.28.0/libexec/git-core/git-lfs /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-lfs

Note your git-core source folder might be somewhere else than /usr/local/Cellar/git/2.28.0/libexec/git-core - you can use locate or other search commands to find it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM