clone
- git clone --depth=1 https://github.com/Dervon/xxxxxxx.git 克隆最新一次更新
- git clone --depth 1 https://github.com/Dervon/xxxxxxx.git 克隆最新一次更新,同上,区别在于将“=”换成了空格
- git clone https://github.com/Dervon/xxxxxxx.git 克隆所有
分支相关
切换分支
git checkout sunxi-next
列出所有分支
git branch -a
git clone --depth=1 git…git后拉取其他分支
$ git clone --depth 1 https://github.com/Dervon/xxxxxxx.git
$ git remote set-branches origin ‘sunxi-next’
$ git fetch --depth 1 origin sunxi-next
$ git checkout sunxi-next
提交相关
git status
git diff
git reset --hard commit_id 退到/进到 指定commit的sha码
git remote -v 查看git信息
git clean -f 和 git reset --hard 工作目录完全回退到最近一次commit的时候.
git format-patch 0163bed3bf59ae74c36cc5138b4c24f1556d8304 -1 生成patch文件
git commit -m"提交信息" 和git push配合提交代码
拉取相关
git pull “origin”