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]
查看状态:git status
查看忽略:cat .gitignore .gitignore例子
编辑文件:vim .gitignore (i插入字符,esc到命令状态,:wq保存退出)
查看改动:git diff (git diff --staged 查看已缓存的改动,git diff HEAD 查询未缓存和已缓存的所有改动)
查看文件:ls -la
查看历史:git log详细
图形界面:gitk
回滚:git reset (--hard 工作区和缓存区均回滚)
列出可用的分支:git branch
创建新分支:git branch (branchname)
创建新分支,并立即切换到它:git checkout -b (branchname)
将分支合并到你的当前分支:git merge
列出远端仓库别名: git remote
添加远端仓库:git remote add [alias] [url]
删掉远端仓库:git remote rm []
从远端仓库下载:git fetch
从远端仓库提取并合并到当前分支:git pull (=git fetch + git merge)
推送你的新分支与数据到某个远端仓库:git push [alias] [branch]
Merge tools
P4Merge:
http://www.perforce.com/product/components/perforce-visual-merge-and-diff-tools
GUI
http://www.sourcetreeapp.com/