一番码客 : 挖掘你关心的亮点。
http://efonfighting.imwork.net
本文目录:
文章目录
cherry-pick 多个commit
git cherry-pick commitid1…commitid100 (不包含第一个commitid)
查找丢失的commit
git fsck --lost-found
git status 中文乱码
git config --global core.quotepath false
git format-patch
1)两个节点之间的提交: [git format-patch 节点A 节点B]
2)单个节点: [git format-patch -1 节点A] (-n就表示要生成几个节点的提交)
3)最近一次提交节点的patch :[git format-patch HEAD^] 依次类推……
git am *.patch //生成提交节点
git apply *.patch //只修改文件,不生成提交节点
强推
//刚刚push到远端还没有人其他人下载或改动的:
git commit --amend
git push --force-with-lease
//其他人已经下载或改动:
git fetch origin
git reset --hard origin/master
分支操作
git push origin local_branch //推送本地新建分支到远程分支
git push --delete origin local_branch //删除远程分支
git branch -m oldname newname //本地分支重命名
git branch -r -D origin/BranchName //删除本地的远程分支
git push origin -d BranchName //远程删除git服务器上的分支
git diff
git diff branch1 branch2 --stat //显示出所有有差异的文件列表
git diff branch1 branch2 文件名(带路径) //显示指定文件的详细差异
git diff branch1 branch2 //显示出所有有差异的文件的详细差异
最大文件大小限制
git config --global pack.packSizeLimit 512m
git status
git status -uno [man git-status] //只显示当前代码库已有的文件状态
删除tag
显示本地 tag
git tag
Remote_Systems_Operation
删除本地tag
git tag -d Remote_Systems_Operation
用push, 删除远程tag
// git push origin :refs/tags/Remote_Systems_Operation
git push --tags
gitignore 修改不起作用
git rm -r --cached .
git add .
git commit -m “update gitignore”
windows下创建.gitignore:
因为windows将.gitignore识别为了文件类型后缀,不让创建没有名字的文件,所以只用用linux环境touch命令。两种途径:
- git bash
- win10 ubuntu
免费知识星球: 一番码客-积累交流
微信公众号:一番码客
微信:Efon-fighting
网站: http://efonfighting.imwork.net