Sha256: 30d60ff506de5bac81dda7961aa16133a072e36ab095c35f56ae79706b62644c
Contents?: true
Size: 1.13 KB
Versions: 3
Compression:
Stored size: 1.13 KB
Contents
--- layout: post category: git title: Git 不常用的好用的命令 --- ### git add * `git add -u` 缓存改动过的文件(已跟踪) * `git commit --amend` 撤销最后一次提交(修改) * `git revert <commit>` 撤消指定的提交 * `git blame <file>` 以列表方式查看指定文件的提交历史 ### git remote - `git remote show <name>` 指定远程版本库更详细的信息 - `git remote prune <name>` 在远程服务器删除分支等,在本地同步; ### git checkout - `git checkout -b <branchname> <origin/branchna>` 在本地创建一个要合并的原创分支 ### git log - `git log --oneline` - `git log -p <path>` 查看指定文件的提交历史 - `git log --pretty=raw` 查看详细的log信息 ### git cat-file - `git cat-file -t <object>` 查看object 类型 ### git commit-tree - `git commit-tree <tree> -m <message>` 基于tree对象创建 commit对象 ### git cherry-pick - `git cherry-pick <commit>` 将其他分支的单次commit合并到当前分支,而不是整个分支合并,也不会扰乱当前分支 ### git replace ### 用远程分支覆盖本地 `git reset --hard origin/master`
Version data entries
3 entries across 3 versions & 1 rubygems