Github:一个部落在另一个遥远的部落仓库中得到分支

5n0oy7gb  于 2022-12-10  发布在  Git
关注(0)|答案(1)|浏览(129)
  • 我在www.example.com上看到一个建议https://github.com/spring-petclinic/spring-petclinic-microservices/issues/216#issuecomment-1342220569。
  • 我的存储库https://github.com/donhuvy/spring-petclinic-microservices/
  • 最终目标:有用于编码的brach feature/spring-cloud-2022.0源代码(不是没有版本/提交的静态zip文件)。
Administrator@21AK22-COM MINGW64 /c/dovy/github
$ git clone https://github.com/donhuvy/spring-petclinic-microservices.git
Cloning into 'spring-petclinic-microservices'...
remote: Enumerating objects: 10446, done.
remote: Total 10446 (delta 0), reused 0 (delta 0), pack-reused 10446
93 MiB/s
Receiving objects: 100% (10446/10446), 7.17 MiB | 1.92 MiB/s, done.
Resolving deltas: 100% (4114/4114), done.

Administrator@21AK22-COM MINGW64 /c/dovy/github
$ git checkout feature/spring-cloud-2022.0
fatal: not a git repository (or any of the parent directories): .git

Administrator@21AK22-COM MINGW64 /c/dovy/github
$ cd spring-petclinic-microservices/

Administrator@21AK22-COM MINGW64 /c/dovy/github/spring-petclinic-microservices (master)
$ git checkout feature/spring-cloud-2022.0
error: pathspec 'feature/spring-cloud-2022.0' did not match any file(s) known to git

Administrator@21AK22-COM MINGW64 /c/dovy/github/spring-petclinic-microservices (master)
$ git pull
Already up to date.

Administrator@21AK22-COM MINGW64 /c/dovy/github/spring-petclinic-microservices (master)

我的本地PC:

git checkout feature/spring-cloud-2022.0

怎么办呢?

ohtdti5x

ohtdti5x1#

git remote add arey https://github.com/arey/spring-petclinic-microservices.git
git fetch arey
git checkout feature/spring-cloud-2022.0
git pull

完整日志

Administrator@21AK22-COM MINGW64 /c/dovy/github/spring-petclinic-microservices (master)
$ git remote add arey https://github.com/arey/spring-petclinic-microservices.git

Administrator@21AK22-COM MINGW64 /c/dovy/github/spring-petclinic-microservices (master)
$ git fetch arey
remote: Enumerating objects: 307, done.
remote: Counting objects: 100% (133/133), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 307 (delta 124), reused 127 (delta 119), pack-reused 174
Receiving objects:  96% (295/307)
Receiving objects: 100% (307/307), 57.52 KiB | 4.11 MiB/s, done.
Resolving deltas: 100% (130/130), completed with 57 local objects.
From https://github.com/arey/spring-petclinic-microservices
 * [new branch]      bugfix/return-to-owner-details -> arey/bugfix/return-to-owner-details
 * [new branch]      feature/Finchley         -> arey/feature/Finchley
 * [new branch]      feature/Greenwich        -> arey/feature/Greenwich
 * [new branch]      feature/GreenwichSR1     -> arey/feature/GreenwichSR1
 * [new branch]      feature/Hoxton           -> arey/feature/Hoxton
 * [new branch]      feature/Micrometer       -> arey/feature/Micrometer
 * [new branch]      feature/circuitBreaker   -> arey/feature/circuitBreaker
 * [new branch]      feature/github-actions   -> arey/feature/github-actions
 * [new branch]      feature/hoxton-sr9       -> arey/feature/hoxton-sr9
 * [new branch]      feature/hystrixDashboard -> arey/feature/hystrixDashboard
 * [new branch]      feature/java8            -> arey/feature/java8
 * [new branch]      feature/java8bis         -> arey/feature/java8bis
 * [new branch]      feature/jib              -> arey/feature/jib
 * [new branch]      feature/layered-jar      -> arey/feature/layered-jar
 * [new branch]      feature/maven            -> arey/feature/maven
 * [new branch]      feature/remove-spring-cloud-starter-bootstrap -> arey/feature/remove-spring-cloud-starter-bootstrap
 * [new branch]      feature/server-config-index-page -> arey/feature/server-config-index-page
 * [new branch]      feature/spring-cloud-2020 -> arey/feature/spring-cloud-2020
 * [new branch]      feature/spring-cloud-2020.0.3 -> arey/feature/spring-cloud-2020.0.3
 * [new branch]      feature/spring-cloud-2021.0 -> arey/feature/spring-cloud-2021.0
 * [new branch]      feature/spring-cloud-2021.0.1 -> arey/feature/spring-cloud-2021.0.1
 * [new branch]      feature/spring-cloud-2022.0 -> arey/feature/spring-cloud-2022.0
 * [new branch]      feature/spring-cloud-gateway -> arey/feature/spring-cloud-gateway
 * [new branch]      feautre/spring-cloud-2021.0.2 -> arey/feautre/spring-cloud-2021.0.2
 * [new branch]      master                   -> arey/master

Administrator@21AK22-COM MINGW64 /c/dovy/github/spring-petclinic-microservices (master)
$ git checkout --track feature/spring-cloud-2022.0
fatal: 'feature/spring-cloud-2022.0' is not a commit and a branch 'spring-cloud-2022.0' cannot be created from it

Administrator@21AK22-COM MINGW64 /c/dovy/github/spring-petclinic-microservices (master)
$ git checkout feature/spring-cloud-2022.0
Switched to a new branch 'feature/spring-cloud-2022.0'
branch 'feature/spring-cloud-2022.0' set up to track 'arey/feature/spring-cloud-2022.0'.

Administrator@21AK22-COM MINGW64 /c/dovy/github/spring-petclinic-microservices (feature/spring-cloud-2022.0)
$ git pull
Already up to date.

Administrator@21AK22-COM MINGW64 /c/dovy/github/spring-petclinic-microservices (feature/spring-cloud-2022.0)
$

Administrator@21AK22-COM MINGW64 /c/dovy/github/spring-petclinic-microservices (feature/spring-cloud-2022.0)
$ git log
commit 8f6684dad4dab5b2bdf57238fbeab5f4f382fb30 (HEAD -> feature/spring-cloud-2022.0, arey/feature/spring-cloud-2022.0)
Author: Antoine Rey <antoine.rey@free.fr>
Date:   Fri Mar 25 18:51:38 2022 +0100

    Bump to Spring Cloud 2022.0.0-M1 and Spring Boot 3.0.0-M1

commit 61324438761d7e9ce96173feddd1b3568ff8674b (arey/master)
Merge: 0307081 f8d05ba
Author: Antoine Rey <antoine.rey@free.fr>
Date:   Fri Mar 25 08:26:45 2022 +0100

    Merge remote-tracking branch 'upstream/master'
...

相关问题