1102CP2_Lab0317

2022 Spring Semester Computer Programming II, NCCU

Lab0217

Tutorial

Installation

Commands

  • git clone
  • git status
  • git commit -m "<your_commit>"
  • git push <remote_name> <branch_name>
  • git log

Lab0317

Tutorial

  • git pull
  • git pull <remote_name>
  • git branch
  • git branch <branch_name>
  • git checkout <branch_name>
  • git merge <branch_name>
  • git remote
  • git remote -v
  • git remote add <remote_name> <URL>
  • fork
  • Pull Request (PR)

Exercise

  1. 在 GitHub 上面找到 chang861224/1092CP2_Lab0317 這個資料夾
  2. 將這個資料夾 fork 到你自己的 GitHub
  3. 將你 fork 來的這個資料夾 clone 到你電腦的 local 端
  4. 創建一個 branch ,名稱為「NCCU<學號>」
  5. 在資料夾裡面新增一個檔案,檔名「Lab0317_<學號>.txt」,檔案內容則是去找一首歌,把歌名和歌詞貼過來
  6. 在 commit 打「<學號>: <歌名>」
  7. 將更新後的資料夾 push 到自己的 GitHub 上,然後發一個 PR 給我

Lab0428

Tutorial

  • git pull
    • git pull <remote_name> <branch_name>
  • git branch
    • git branch <branch_name>
    • git checkout <branch_name>
    • git merge <branch_name>
  • git remote
    • git remote -v
    • git remote add <remote_name> <URL>
  • git reset
    • git reset --hard
  • fork
  • Pull Request (PR)

Exercise

  1. 進入之前 clone 到你的電腦 local 端的 1102CP2_Lab0317 資料夾 (如果已經砍掉的話,就在你自己的 GitHub 上面再 clone 一次)
  2. git remote 新增 git@github.com:chang861224/1102CP2_Lab0317.git 這個遠端網址 (用 git bash 的人,麻煩新增 https://github.com/chang861224/1102CP2_Lab0317.git
  3. 將你的電腦 local 端的 1102_CP2_Lab0317 資料夾更新到最新版本(要更新到跟我的 GitHub 一樣才是最新版本)
  4. 進入上次你創建的「NCCU_<你的學號>」這個 branch
  5. 在這裡修改你上次檔名為「Lab0317_<你的學號>.txt」的歌詞,在檔案的最前面新增歌名和作詞、作曲人
  6. 在 commit 打「[add info] <你的學號>: <歌名>」
  7. 將更新後的這個分支 push 到你自己的 GitHub 上,然後發一個 PR 給我