git常用指令合集
全局配置
$ git config --global user.name "Name"
$ git config --global user.email "**.com"
$ git config --list
局部仓库配置
$ git config user.name "Name"
$ git config user.email "**.com"
$ git config --list
常用指令
-
$ git add $ git commit $ git push -
查看日志
$ git log --pretty=oneline $ git log --oneline $ git reflog -
版本控制
$ git reset --hard index $ git reset --hard head^^ $ git reset --hard head~2 -
分支
$ git branch -v $ git checkout branchName $ git branch branchName-
合并
$ git chekout branchName $ git merge branchName
-
-
远程push源设置
$ git remote -v $ git remote add origin https:...... $ gite push origin branchName -
克隆拉取
$ git clone htpps:..... pull = fetch + merge $ git fetch origin/branchName