Week5-3_Github_Fork_Branch_PR
English translation
1. Fork the target repository into your account
- Find the repository URL yourself and open it.
- Click Fork in the upper right.
- Clicking forks the repository without a separate confirmation step.
2. Clone into your local repository
- After forking, use it as if it were your own repository.
- For convenience, use a temporary folder on Google Drive instead of the local drive of the person using the fork.
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
3. Create a branch
!git checkout -b chorok-crewSwitched to a new branch 'chorok-crew'
!git statusOn branch chorok-crew nothing to commit, working tree clean
!git branch* [32mchorok-crew[m main[m
4. Edit Readme.md on the local branch
5. Commit the changes and push to the remote
!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-crewCounting 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'.