반응형
Github 풀 요청을 통합 diff로 다운로드합니다.
Github pull 요청에 포함된 변경 사항을 통합 diff로 다운로드하려면 어떻게 해야 합니까?
커밋을 diff/patch 파일로 보려면 다음을 추가합니다..diff
또는.patch
URL 끝으로 이동합니다. 예:
- https://github.com/weppos/whois/pull/90
- https://github.com/weppos/whois/pull/90.diff
- https://github.com/weppos/whois/pull/90.patch
다소 관련이 있는, git 다운로드 요청 123을 풀하여 패치하도록 합니다.mylocalbranch
로컬로 실행:
git checkout -b mylocalbranch
git pull origin pull/921/head
PR 변경 사항을 준비되었지만 커밋되지 않은 상태에서 로컬 저장소로 변경하려면 다음을 검토할 수 있습니다.
git pull origin pull/123/head --no-commit
여기서 패치 파일을 생성하려면 다음과 같이 하십시오.
git diff --cached > pr123.diff
관련 솔루션에 대한 다른 대안이 있습니다.원래 질문에 답하고 다음을 사용합니다.git fetch
그리고.FETCH_HEAD
.
git fetch origin pull/921/head
cat .git/FETCH_HEAD
# Then either of
git diff `git merge-base FETCH_HEAD HEAD`..FETCH_HEAD > diff.diff # Downloads the unified diff as asked in the original question
git merge FETCH_HEAD # Applies the diff
언급URL : https://stackoverflow.com/questions/6188591/download-github-pull-request-as-unified-diff
반응형
'programing' 카테고리의 다른 글
정적 메서드 내에서 세션 변수 값을 가져오려면 어떻게 해야 합니까? (0) | 2023.06.26 |
---|---|
crt0.o와 crt1.o -- 무엇이 다릅니까? (0) | 2023.06.26 |
jQuery를 사용하여 양식 제출 (0) | 2023.06.26 |
데이터 프레임의 랜덤 행 표본 (0) | 2023.06.26 |
mySQL에서 테이블을 만들 때 변수를 사용하는 방법은 무엇입니까? (0) | 2023.06.26 |