기본 콘텐츠로 건너뛰기

[git] fork 해온 저장소를 최신 상태로 유지하기



Go 관련 번역 작업을 할 일이 있어서 했던 일들을 기록해둔다.
이슈에 내가 할 작업 분량을 공지하고 (다른 사람이 두번 삽질 안하게)
바로 fork 해서 내 저장소로 옮겨놓고
수정하고 pull request 까지 끝낸 뒤 원본에서 merge까지 끝났다.

그 다음은?

내가 fork 한 저장소의 작업과 별개로 원본의 작업은 진행되고 있고 아마 내 저장소의 것들은 상대적으로 구버전일 것이다.
원본에서 pull로 땡겨와서 merge 하기 위해 remote 를 먼저 등록해두자.

$ git remote add upstream git@github.com:golanger/go-tour-translator.git

확인해본다.
$ git remote
origin
upstream

origin 과 새로 추가한 upstream. 두개를 확인할 수 있다.
그러면 upstream으로부터 pull 해보자.

$ git pull upstream
From github.com:golanger/go-tour-translator
 * [new branch]      master     -> upstream/master
You asked to pull from the remote 'upstream', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.

그냥 pull 하니까 오류를 뱉는다. 어떤 브랜치인지 지정 안했다는 얘기지뭐. 디폴트로 master를 해줬으면 좋겠지만 확실한게 좋다.
upstream에서 master를 가져오도록 해보자.

$ git pull upstream master
From github.com:golanger/go-tour-translator
 * branch            master     -> FETCH_HEAD
Already up-to-date.
변경이 있으면 변경이 된 내용이 나올 것이다.
pull은 내 저장소에서 pull 하는 것고 별반 다르지 않다.
충돌이 있으면 merge 하든가 알아서 하자.
이것이 git 의 유연한 점이라고 생각한다.

여기까지 했으면 내 로컬의 형상과 내 저장소의 형상이 달라졌을 것이다.
commit 할게 있으면 commit 하고 내 저장소에 push 해주자

$ git push

upstream쪽에서 내가 수정하고 있는 파일에 대한 수정을 여러 사람이 제각각 fork + pull request 한다면 좀 불편할 수도 있겠다.
아마 번역이 딱 이런 예일 듯 싶지만서도.
필요하면 issue 에서 할당받을 양을 따로 파일로 찢고 branch를 딴 후 최종 머지할때 합하는 것도 좋은 생각이겠다.

댓글

이 블로그의 인기 게시물

세상 간단한 https(+secured websocket): Caddy

nginx, apache2 같은 걸로 매번 certbot 연동을 통해 https 하는게 지겨워서 알아보니 Caddy라는게 있더라. 설치법은 강하게 크기 위해 알아서 해본다. # cat /etc/caddy/Caddyfile your.shitty.site:8123 {   proxy / localhost:9123 {     websocket     transparent   } } 이건 외부에서 8123으로 들어오는 걸 내부적으로 9123로 맞춰서 https 맞춰주는 reverse proxy. 만일 port를 생략하면 # cat /etc/caddy/Caddyfile your.shitty.site {   proxy / localhost:9123 {     websocket     transparent   } } 기본포트인 443으로 되어 https://your.shitty.site 로 접속이 된다. 요새 말썽이던 cloudflare 버리고 netlify domain이랑 caddy를 쓰니까 앓던 이가 빠진 느낌. 이 조합은 당분간 계속 써야겠다 싶다.

저지연 오디오 생성 LLVC 사용기

https://github.com/KoeAI/LLVC 써봄 CUDA 11.8 버전 쓰고 있어 pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 VC 없어서 설치 https://wikidocs.net/168848 참조 FAIRSEQ 관련 오류 https://github.com/facebookresearch/fairseq/issues/2908 pip install editdistance  설치 No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8' 오류 멀쩡하게 있는데 안됨. pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0+cu118 --extra-index-url https://download.pytorch.org/whl/cu118 다시 설치 set DISTUTILS_USE_SDK=1 이게 문젠가 설정하고 재도전 Using cached ruamel.yaml.clib-0.2.8-cp311-cp311-win_amd64.whl (118 kB) Building wheels for collected packages: fairseq   Building wheel for fairseq (pyproject.toml) ... error   error: subprocess-exited-with-error   × Building wheel for fairseq (pyproject.toml) did not run successfully.   │ exit code: 1   ╰─> [1829 lines of output]       No CUDA runtime is found, usi...