$ git config --global user.email johndoe@example.com
初始化
git init提交
git add .
加入控管
git commit -am "紀錄內容"
創造分支
git branch "branch_name"
進入分支
git checkout "branch_name"
創造並進入分支
git co -b "branch_name"
刪除分支
git branch -d "branch_name"
彩色顯示
git config --global color.ui true
簡寫
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.br branch
美化Git lg顯示
git config --global alias.lg "log --graph --pretty=format:'%Cred%h - %Cgreen[%an]%Creset -%C(yellow)%d%Creset %s %C(yellow)<%cr>%Creset' --abbrev-commit --date=relative"
git reset HEAD 取消一次的add
git commit -m "这次存档的讯息"
git push origin master (上传到 github)
彩色顯示
git config --global color.ui true
簡寫
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.br branch
美化Git lg顯示
git config --global alias.lg "log --graph --pretty=format:'%Cred%h - %Cgreen[%an]%Creset -%C(yellow)%d%Creset %s %C(yellow)<%cr>%Creset' --abbrev-commit --date=relative"
86400秒免輸入帳號密碼可pull/push
git config --global credential.helper 'cache --timeout 86400'方式
git add [档案名称] (单个档案) 或 git add . (全部档案)git reset HEAD 取消一次的add
git commit -m "这次存档的讯息"
git push origin master (上传到 github)
沒有留言:
張貼留言