강의자료 · 마이크로프로세서응용설계

Week5-3_Github_Fork_Branch_PR

1. 내 Repository에 대상 Repo를 Fork하기

2. 내 Local Repository에 Clone하기

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.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
cd repository-fork
/content/drive/My Drive/temp/repository-fork

3. Branch 만들기

!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
* chorok-crew
  main

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)
remote: Resolving deltas: 100% (1/1)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
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 하기