提交文件到索引中 git add
1 | git add -A #将所有新增、修改、删除的文件提交到索引中 |
查看文件每行的最后提交人和时间 git blame
1 | git blame <file> #查看文件每行的最后提交人和时间 |
查看所有分支,并显示版本信息
1 | git branch -v |
在本地创建远程分支
1 | git checkout -b <local-branch-name> origin/<remote-branch-name> |
clone项目
1 | git clone <giturl> |
git配置 git config
1 | git config --global credential.helper cache #全局模式缓存凭证 15 分钟 |
把远程分支拉到本地 git fetch
1 | git fetch origin <branch_name> |
初始化当前目录为仓库 git init
1 | git init |
git log
1 | git log --stat --author=<pattern> --after=<date> --before=<date> #查看某人一段时间的提交记录,并显示详情 |
撤销所有合并操作
1 | git merge --abort |
拉取远程分支到本地
1 | git pull origin <branch-name> |