環境設置
- git config –global user.email "you@example.com"
- git config –global user.name "Your Name"
- git config –global core.editor notepad
其他
- git config –global color.ui true
- git config –global alias.lg "log –oneline"
GitHub
世界最大男性交友平台
Code 倉庫 (Create / Delete)
觀念

提交檔案

Before commit
- git status
- git diff
- git diff –cached
Commit
- git commit
- git commit -m "My first commit"
Commit 時機
看個人風格和公司需求
沒事多 commit,多 commit 沒事
查看歷史紀錄
- git log
- git lg
- git config –global alias.lg "log –oneline"
歷史紀錄

Remove file
git rm <file>
Untrack file
git rm <file> –cached
Rename file
git mv <file> <new_name>
回到過去
git checkout
git branch -f master
暫存
- git stash
- git stash save
- git stash list
- git stash pop
回到過去保留現在
- git reset
- git reset –hard
所以那個 GitHub 呢

遠端
- git remote add origin <GitHub repo link>
- git remote
- git remote -v
Branch

List Branchs
- git branch
- git branch -a
- git branch -v
- git branch -vv
- git branch -d
Create gh-pages
- git branch gh-pages
- git checkout
- git push -u origin gh-pages
進入網址
<username>/github.io/<repo name>
(可能要等一下)
合併分支
- git merge <branch>
- git rebase <branch>
其他重要的指令
- git clone
- git fork
- git pull
- git commit –amend
- git blame
- git cherry-pick
- git bisect
GIT 版本控制 Rice
{"metaMigratedAt":"2023-06-15T13:55:15.408Z","metaMigratedFrom":"YAML","title":"GIT 版本控制","breaks":true,"slideOptions":"{\"theme\":\"moon\",\"transition\":\"fade\"}","contributors":"[{\"id\":\"30a8feb1-7635-4e18-9daa-0fa53b4cc8f5\",\"add\":2832,\"del\":87}]"}