L11_Github_Fork_PR
1. 내 Repository에 대상 Repo를 Fork하기
- 직접 해당 repo의 url을 알아내 찾아가야한다
- 우측 상단에 fork 클릭
- 클릭하면 별도의 확인절차 없이 fork된다
2. 내 Local Repository에 Clone하기
- Fork 이후에는, 마치 내 Repository인 것처럼 사용하면 된다
- 편의상, ’Fork해 사용하는 사람’의 Local 드라이브 대신, 구글드라이브에 임시 폴더에서 진행한다
from google.colab import drive
drive.mount('/content/drive')
Mounted at /content/drive
cd /content/drive/MyDrive/temp/
/content/drive/MyDrive/temp
!git clone "https://github.com/chorok-crew/repository-fork.git"
Cloning into 'repository-fork'...
remote: Enumerating objects: 3, done.[K
remote: Counting objects: 100% (3/3), done.[K
remote: Compressing objects: 100% (2/2), done.[K
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0[K
Unpacking objects: 100% (3/3), done.
cd repository-fork
/content/drive/My Drive/temp/repository-fork
!git checkout -b chorok-crew
Switched to a new branch 'chorok-crew'
!git status
On branch chorok-crew
nothing to commit, working tree clean
!git branch
* [32mchorok-crew[m
main[m
4. Local branch에서 Readme.md 수정하기
5. 수정된 사항 commit하고, remote에 push하기
!git config --local user.email "chorok.crew@gmail.com"
!git config --local user.name "chorok-crew"
!git add .
!git commit -m "Edit Readme.md by chorok-crew"
[chorok-crew 64bf80b] Edit Readme.md by chorok-crew
1 file changed, 2 insertions(+)
!git remote add repo-fork https://username:token@github.com/chorok-crew/repository-fork.git
!git push -u repo-fork chorok-crew
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 50% (1/2)
Compressing objects: 100% (2/2)
Compressing objects: 100% (2/2), done.
Writing objects: 33% (1/3)
Writing objects: 66% (2/3)
Writing objects: 100% (3/3)
Writing objects: 100% (3/3), 361 bytes | 120.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 0% (0/1)[K
remote: Resolving deltas: 100% (1/1)[K
remote: Resolving deltas: 100% (1/1), completed with 1 local object.[K
To https://github.com/chorok-crew/repository-fork.git
8aab981..64bf80b chorok-crew -> chorok-crew
Branch 'chorok-crew' set up to track remote branch 'chorok-crew' from 'repo-fork'.
6. Github에서 Pull Request 하기