修改最近一次提交信息
确保没有未提交的更改,运行以下命令
1 | git commit --amend |
编辑后保存并关闭编辑器,运行以下命令
1 | git push --force-with-lease |
恢复误删提交记录
查看操作记录
1 | git reflog |
恢复记录
1 | git reset --hard aabbcc2 |
.gitignore 修复
- 文件 aaa 已经推送到远端
- .gitignore 添加 aaa/** 不生效
按以下步骤: - .gitignore 添加 aaa/**
- git add .gitignore
- git commit -m “update .gitignore”
- git rm -r –cached aaa
- git add .
- git commit -m “fix .gitignore”
修改文件夹名称大小写
1 | # oldFolderName 旧名称 |