程式/網站開發經驗
版本控制經驗
shell 熟悉程度
But....萬事最怕的But....
老師/老闆/同學/自己:
┬─┬ ノ( ' - 'ノ) 我能翻了這張桌子嗎?
三個月後就只有神知道了 (  ̄ 3 ̄)y▂ξ
but....又是一個but....
誰他X的改了我的 code !
我的比較好!
我三小時的努力...( ºΔº )
這一切都是____的陰謀啦!
誰寫的!這結果不對啊!Σ(;゚д゚)
ex:rcs
ex:CVS、Subversion
ex:Git
git config --global user.email "your email"
git config --global user.name "Your Name"
git config --global color.ui true
git config --global alias.co commit
git config --global alias.st status
git config --global alias.lg "log --color --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
git help "command"
git init
public/private
GitHub EducationREADME.md
Markdowngit clone "git repo"
在GitHub上建立一個repo
git status
git st
git add "file"
git add .
git commit
git co
偷懶(「・ω・)「
git commit -m "commit"
git commit -am "commit"
add救星
git reset "file"
把剛剛新增的檔案做commit
然後用git status確認commit成功
何時該commit?
F_CK & sh_t commit
http://www.commitlogsfromlastnight.com/༼ つ ◕_◕ ༽つ Give RELAY
git diff
git diff --cached
git log
git lg
git show "revisions"
git checkout "revision"
至少新增三筆commit
然後試著查看舊版本
git checkout -- "file"
git revert "reversion"
git reset "reversion"
git reset --hard "reversion"
git rm "file"
git rm --cached "file"
git mv "oldname" "newname"
更換檔案位置
給大家玩一下以上功能
git remote -v
git push
把一個repo clone下來
新增一commit並push上去
git remote add "name" "URL"
git remote rm "name"
git remote remove "name"
git pull "name"
git push "name"
另外開一個新資料夾
然後在這資料夾中pull repo
最後新增幾筆commit後push回去
Branch
git branch
git branch -v
create branch
git branch "new branch"
git checkout -b "new branch"
更換branch
git checkout "branch"
git push "remote" "remote_branch"
git push "remote" "local_branch":"remote_branch"
git pull "remote" "remote_branch"
刪除遠端branch
git push "remote" :"branch"
刪除本地branch
git branch -D "branch"
開幾個branch做前面指令的練習
branch的push一定要試試看
git merge "branch"
merge自動commit
git config --global core.mergeoptions --no-edit
Conflict
git blame "file"
練習merge,並試著創造conflict
嘗試自己解conflict
其實只要放到gh-pages的branch
rebase
git rebase "revision"
git rebase --onto "new" "cur"
git rebase -i
同場加映: .git權限很重要
感嘆師父,讚嘆師父,Git超棒der