1,基本命令
git config [--global] user.[name,email] xxx
git init
git add file1 [file2 ... ]
git commit
git status
2,更改编辑器
git默认用nano
git config --global core.editor vim
还可以定义自己的diff工具:
git config --global merge.tool vimdiff
3,配置文件
/etc/gitconfig :系统, 对所有用户, 使用 git config --system 来读写
~/.gitconfig :用户配置, 使用 git config --global 来读写
查看配置:
git config --list
git config user.name
4,clone
三种协议:http , git , ssh
ssh: git clone user@hostname:/path/to/project newname
git: git clone git://hostname/path/project
5, fetch
git fetch 远程仓库名
6, push
git push 远程仓库名 本地分支名:远程分支名
99,网络资源
opengit.org
progit.org/book/
progit.org/book/zh/