Carthage: How to get the very latest version of a given repository?

16,036

Solution 1

The documentation states

Carthage supports several kinds of version requirements:

  • >= 1.0 for “at least version 1.0”
  • ~> 1.0 for “compatible with version 1.0”
  • == 1.0 for “exactly version 1.0”
  • "some-branch-or-tag-or-commit" for a specific Git object (anything allowed by git rev-parse)

so I believe

github "jspahrsummers/xcconfigs" "HEAD"

should work as expected, since "HEAD" is a valid argument for git rev-parse

Alternatively

github "jspahrsummers/xcconfigs" "master"

or any other branch

Solution 2

Simply github "jakecraige/RGB" will yell No tagged versions found for github "jakecraige/RGB"

Better is to use github "jakecraige/RGB" "master"

You may want to read Carthage Tutorial: Getting Started

branch name / tag name / commit name means “Use this specific git branch / tag / commit”. For example, you could specify master, or a commit has like 5c8a74a.

Solution 3

This was answered by mdiep on Carthage's github page:

The latest version refers to something that has an actual version—a release or tag. If you want the most latest commit, you need to specify the branch you want to pin to.

Share:
16,036
Chris Conover
Author by

Chris Conover

I am a senior level iOS app developer serving clients in the Bay Area and beyond. I have 20+ years experience as a professional engineer, the last 6+ of which have been in iOS, and have a background in Computer Science. I have worked on interesting projects in both Swift (my focus since its release), as well as Objective-C. Some recent projects include Ava, a novel app that helps deaf people communicate in group conversations, Twine, an app that helps people start and develop savings plans, and an internal hospital management app for a hospital chain, backed by GraphQL. I have experience in getting existing applications back on track, and also in starting new applications from scratch. From all my professional engineering experience, I have come to appreciate the lasting benefits of clean architecture, and that is my primary focus. Accordingly, I have experience with applications of MVVM, reactive and unidirectional flow architectures, and have written foundational logic for multi-party chat and distributed systems, caching and connecting to REST and GraphQL backends. Beyond my experience in iOS development, I have extensive experience in audio and video processing, system software development, and several years of backend web development. If you are looking for help on a project, feel free to reach out to me on LinkedIn: http://curiousapplications.com.

Updated on June 14, 2022

Comments

  • Chris Conover
    Chris Conover almost 2 years

    The Cartfile documentation makes the assertion:

    If no version requirement is given, any version of the dependency is allowed.

    with the contradictory example:

    # Use the latest version
    github "jspahrsummers/xcconfigs"
    

    Furthermore, it is not stated, but from testing, I infer that "latest" is actually the version of the latest tag. Is this interpretation correct? And if so, how does one specify the very latest commit - do you have to manually check and specify the latest commit, or is there a simpler way?