Giithub 로컬에서 특정 pull request 가져오기

2151 단어 GitGitHub

개요


OSS 관리자를 할 때 github로 특정pull request의 정당성을 확인하고 싶은 일이 있습니다.따로 체크아웃하면 되죠?단순히 생각했을 뿐이지만 상당히 귀찮아서 적어놨어요.

방법


어쨌든 먼저 clone repository,branch를 보세요.
$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/feature/support_gemfile
  remotes/origin/master
  remotes/origin/test_1.0.0
pull request를 넣지 않은 branch입니다.
다음 내용을 참조하면 이렇게 하는 것이 좋을 것 같다.
Checking out pull requests locally - User Documentation
$ git fetch origin pull/ID/head:BRANCHNAME
이번 경우25.
fetch해봐
$ git fetch origin pull/25/head:abolish_ruby_server_dir
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 1), reused 3 (delta 1)
Unpacking objects: 100% (5/5), done.
From https://github.com/roma/roma
 * [new branch]      refs/pull/25/head -> abolish_ruby_server_dir
checkout해봐
$ git branch -a
  abolish_ruby_server_dir
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/feature/support_gemfile
  remotes/origin/master
  remotes/origin/test_1.0.0
$ git checkout abolish_ruby_server_dir
Switched to branch 'abolish_ruby_server_dir'
됐어.

Reference

좋은 웹페이지 즐겨찾기