问题
What are the list of Carthage related files which are good if pushed to git. I know, - Cartfile - Cartfile.private - Cartfile.resolved
What about the Build and Checkout folders?
回答1:
From this link:
Whether you commit the Build and Checkouts directories to your version control repository is entirely up to you. It’s not required, but doing so means that anybody who clones your repository will always have the binaries and / or source for each dependency available.
This can be a useful insurance policy of sorts, for example, if Github is unavailable or a source repository is removed completely then you’d have a clean backup.
I think it's best to commit the Build and Checkout directories to git. If you don't and someone clones your repository they will be forced to rebuild the Carthage binaries. Depending on the Cartfile what they build may be different to what was tested by you before you last committed to the repository. For example, let's assume the Cartfile in the git repository has the line github "CocoaLumberjack/CocoaLumberjack" ~> 3.2. Assume when you tested your code and committed the Cartfile the latest version of CocoaLumberjack was 3.2.0. Now assume 2 months later someone clones your repository and is forced to rebuild the binaries but at that time the CocoaLumberjack latest version is 3.2.3. This person will end up with different code to what you tested. They may not realise it's different.
回答2:
If you don’t commit the Ford, you should use carthage bootstrap
instead of update — it will use the versions specified in the Cartfile.resolved
.
来源:https://stackoverflow.com/questions/39662504/list-of-carthage-files-to-be-pushed-to-git