配置
$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"
初始化
$ git init
$ git clone xxx
常规操作
$ git add readme.txt
$ git commit -m "xxx"
比较
$ git status
$ git diff readme.txt
日志
$ git log [--pretty=oneline]
$ git reflog
回退版本
$ git reset --hard HEAD^ (HEAD^,HEAD^^,HEAD~100)
$ git reset --hard 1094a
撤销修改
$ git checkout -- file
$ git reset HEAD readme.txt
分支管理
$ git checkout -b <name> ($ git branch <name> $ git checkout <name>)
$ git branch
$ git merge <name>
$ git branch -d <name>
远程仓库
$ git remote
$ git remote -v
配置颜色
$ git config --global color.ui true
Git常用命令操作
最新推荐文章于 2023-07-02 23:59:19 发布