별도의 리모콘을 추가하지 않고 어떻게 포크를 동기화 상태로 유지할 수 있습니까?
someone/foobar
GitHub에 저장소가 있다고 가정 해 보겠습니다 me/foobar
.
어떻게 할 새로운 커밋을 끌어 부모 저장소에서 내 포크에 직접 하지 않고, 별도의 리모컨을 추가 하고 거기에서 정기적으로 끌어 기억 ?
목표는 다음과 같습니다.
git pull
부모 저장소에서 가져 오기git push
내 포크에 모든 것을 보내기 위해
갈래의 Git 저장소 me / foobar를여십시오 .
비교를 클릭 하십시오 .
당신은 알림을 받게됩니다 :
비교할 것이 없습니다.
someone : master 는 me : master의 모든 커밋을 최신 상태로 유지합니다 . 비교를 위해 베이스 를 전환 해보 십시오.
이 페이지 에서베이스 전환을 클릭 하십시오.
그런 다음 분기 한 후 누군가 / foobar 에 대한 모든 커밋을 볼 수 있습니다.
풀 요청 생성을 클릭하십시오 .
풀 요청에 제목과 설명을 제공하고 풀 요청 생성을 클릭 하십시오 .
다음 페이지에서 페이지 맨 아래로 스크롤하여 병합 요청 병합 및 병합 확인을 클릭하십시오 .
Git 리포지토리 me / foobar 가 업데이트됩니다.
편집 : rebase 옵션이 여기에 표시됩니다 :
git remote set-url origin git@github.com:someone/foobar
git remote set-url origin --push git@github.com:me/foobar
There is one caveat though:
This is perfect if you are the only one making changes to your fork.
However, if it is shared with other people, you may have to pull from your fork, in which case a separate remote is the only solution.
Edit:
Actually, you can git pull git@github.com:me/foobar
, which removes the caveat.
The choice is yours as to which is easier to remember.
I used a fairly simple method using the GitHub Web UI to do that:
- Open the original Git repository (not the forked Git repository
me/foobar
) - Jump to the src folder, and open the file you want to change
- Click the pen icon. It will automatically create a label in your personal fork named "patch-1" based on the current version of the master repository:
- Enjoy!
또 다른 옵션은 Update from upstreamRepoName/master
Mac 용 GitHub 의 버튼 을 사용하는 것 입니다 (Windows 용 GitHub라고 가정합니다).
다른 리모컨을 추가하지 않고 어떻게 할 수 있는지 모르겠지만 항상 갈 수있는 리포지를 리모컨으로 추가하여 upstream
간단하게 수행 할 수 있습니다.
git branch -a|grep remotes/upstream| while IFS="/" read p r b; do echo Syncing $r/$b to origin/$b; git push origin $r/$b:refs/heads/$b; done
그러면 모든 분기를 포함하여 모든 분기가 동기화됩니다. 새 refs/heads/
분기 만들기 ( 기존 분기 만 업데이트하려면 제거 ). 분기가 분기 된 경우 해당 분기에 오류가 발생합니다.
'Programing' 카테고리의 다른 글
PHP는 하나의 배열을 다른 배열에 추가합니다 (array_push 또는 + 아님) (0) | 2020.04.09 |
---|---|
Vim : 커서를 마지막 위치로 이동 (0) | 2020.04.09 |
Resource Acquisition is Initialization (RAII)이란 무엇입니까? (0) | 2020.04.09 |
C ++에서 CSV 파일을 읽고 구문 분석하는 방법 (0) | 2020.04.09 |
“sh”또는“bash”명령을 사용하지 않고 쉘 스크립트를 어떻게 실행합니까? (0) | 2020.04.09 |