WIKI
https://git.wiki.kernel.org/index.php
參考手冊
GIT安裝
http://www.ihref.com/read-16377.html
GIT配置和基本使用
http://www.ihref.com/read-16369.html
教程Tutorias
https://training.github.com/kit/
http://www-cs-students.stanford.edu/~blynn/gitmagic/intl/zh_cn/
CHEAT SHEET
https://training.github.com/kit/downloads/github-git-cheat-sheet.pdf
命令行
配置:
git config --global user.name "jflujin"
git config --global user.emailjflujin@163.com
加快捷:?git config --global alias.gg?"log --graph --all --decorat --oneline"
? ? ?使用:git gg
檢查配置:git config --list
初始:git init
添加跟蹤:git add (add . 增加所有文件及子目錄文件)
提交:git commit -m "..." ?(-a 同時加所有跟蹤文件 --all 增加全部包括文件更名和移動)
克隆:git clone [url]
查看狀態(tài):git status
查看忽略:cat .gitignore?.gitignore例子
編輯文件:vim .gitignore (i插入字符夺巩,esc到命令狀態(tài)丈攒,:wq保存退出)
查看改動:git diff (git diff --staged 查看已緩存的改動俯邓,git diff HEAD 查詢未緩存和已緩存的所有改動)
查看文件:ls -la
查看歷史:git log詳細
圖形界面:gitk
回滾:git reset (--hard 工作區(qū)和緩存區(qū)均回滾)
列出可用的分支:git branch
創(chuàng)建新分支:git branch (branchname)
創(chuàng)建新分支降盹,并立即切換到它:git checkout -b (branchname)
將分支合并到你的當前分支:git merge
列出遠端倉庫別名:?git remote?
添加遠端倉庫:git remote add [alias] [url]
刪掉遠端倉庫:git remote rm []
從遠端倉庫下載:git fetch
從遠端倉庫提取并合并到當前分支:git pull (=git fetch + git merge)
推送你的新分支與數(shù)據(jù)到某個遠端倉庫:git push [alias] [branch]
Merge tools
P4Merge:
http://www.perforce.com/product/components/perforce-visual-merge-and-diff-tools
GUI
http://www.sourcetreeapp.com/