2022 Spring Semester Computer Programming II, NCCU
- Windows
https://git-scm.com/downloads - Mac OS
brew install git
- Linux (Ubuntu)
apt-get install git
git clone
git status
git commit -m "<your_commit>"
git push <remote_name> <branch_name>
git log
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)
- 在 GitHub 上面找到 chang861224/1092CP2_Lab0317 這個資料夾
- 將這個資料夾 fork 到你自己的 GitHub
- 將你 fork 來的這個資料夾 clone 到你電腦的 local 端
- 創建一個 branch ,名稱為「NCCU<學號>」
- 在資料夾裡面新增一個檔案,檔名「Lab0317_<學號>.txt」,檔案內容則是去找一首歌,把歌名和歌詞貼過來
- 在 commit 打「<學號>: <歌名>」
- 將更新後的資料夾 push 到自己的 GitHub 上,然後發一個 PR 給我
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)
- 進入之前 clone 到你的電腦 local 端的 1102CP2_Lab0317 資料夾 (如果已經砍掉的話,就在你自己的 GitHub 上面再 clone 一次)
- 用
git remote
新增 git@github.com:chang861224/1102CP2_Lab0317.git 這個遠端網址 (用 git bash 的人,麻煩新增 https://github.com/chang861224/1102CP2_Lab0317.git) - 將你的電腦 local 端的 1102_CP2_Lab0317 資料夾更新到最新版本(要更新到跟我的 GitHub 一樣才是最新版本)
- 進入上次你創建的「NCCU_<你的學號>」這個 branch
- 在這裡修改你上次檔名為「Lab0317_<你的學號>.txt」的歌詞,在檔案的最前面新增歌名和作詞、作曲人
- 在 commit 打「[add info] <你的學號>: <歌名>」
- 將更新後的這個分支 push 到你自己的 GitHub 上,然後發一個 PR 給我