programing

깃허브에서 다른 사람의 포크에 가지를 가져오려면 어떻게 해야 합니까?

powerit 2023. 6. 27. 22:34
반응형

깃허브에서 다른 사람의 포크에 가지를 가져오려면 어떻게 해야 합니까?

GitHub의 평판에서 포크를 가져왔습니다.저는 다른 사용자의 포크에 있는 지점에서 코드를 얻고 싶습니다.

이 사용자의 전체 보고서를 별도의 로컬 보고서로 복제해야 합니까? 아니면 다음과 같은 작업을 수행할 수 있습니까?git checkout link_to_the_other_users_branch?

$ git remote add theirusername git@github.com:theirusername/reponame.git
$ git fetch theirusername
$ git checkout -b mynamefortheirbranch theirusername/theirbranch

첫 번째 단계에서 원격을 추가할 때 사용할 수 있는 "올바른" URI가 여러 개 있습니다.

  • git@github.com:theirusername/reponame.gitSSH 기반 URI입니다.
  • https://github.com/theirusername/reponame.gitHTTPS URI입니다.

어떤 것을 사용하고 싶은지는 상황에 따라 달라집니다.GitHub에는 차이점을 설명하고 다음을 선택하는 데 도움이 되는 도움말 기사가 있습니다.원격 리포지토리의 URL 선택

합금의 제안은 저에게 효과가 없었습니다.이 작업은 다음과 같습니다.

git remote add theirusername https://github.com/theirusername/reponame
git fetch theirusername
git checkout -b mynamefortheirbranch theirusername/theirbranch

리소스:

언급URL : https://stackoverflow.com/questions/9153598/how-do-i-fetch-a-branch-on-someone-elses-fork-on-github

반응형