gitspringdoc

Checkout and test springdoc-openapi branch


I want to checkout and test a development branch from this project:

https://github.com/springdoc/springdoc-openapi/pull/3007

I tried:

git checkout mschout:spring-boot-3.5-support
error: pathspec 'mschout:spring-boot-3.5-support' did not match any file(s) known to git

Can you guide me how I can properly checkout this branch?


Solution

  • mschout:spring-boot-3.5-support is a branch in the forked repository. You can use gh, an official GitHub CLI to switch to this branch:

    $ gh co 3007
    remote: Enumerating objects: 55, done.
    remote: Counting objects: 100% (45/45), done.
    remote: Compressing objects: 100% (30/30), done.
    remote: Total 55 (delta 16), reused 36 (delta 7), pack-reused 10 (from 1)
    Unpacking objects: 100% (55/55), 11.30 KiB | 1.41 MiB/s, done.
    From https://github.com/springdoc/springdoc-openapi
     * [new ref]             refs/pull/3007/head -> spring-boot-3.5-support
    Switched to branch 'spring-boot-3.5-support'
    

    If you don't want to install gh you can also add a new remote that points to the forked repository and checkout a branch from it:

    $ git remote add fork https://github.com/mschout/springdoc-openapi
    $ git fetch fork
    remote: Enumerating objects: 55, done.
    remote: Counting objects: 100% (45/45), done.
    remote: Compressing objects: 100% (30/30), done.
    remote: Total 55 (delta 16), reused 30 (delta 7), pack-reused 10 (from 1)
    Unpacking objects: 100% (55/55), 11.39 KiB | 416.00 KiB/s, done.
    From https://github.com/mschout/springdoc-openapi
     * [new branch]          main                    -> fork/main
     * [new branch]          spring-boot-3.5-support -> fork/spring-boot-3.5-support
    $ git checkout spring-boot-3.5-support
    branch 'spring-boot-3.5-support' set up to track 'fork/spring-boot-3.5-support'.
    Switched to a new branch 'spring-boot-3.5-support'