一、.gitignore規(guī)則不生效的解決辦法
每次修改.gitignore忽略配置文件后,執(zhí)行以下命令:
git rm -r --cached .
git add .
git commit -m 'update .gitignore'
二、Checkout操作被拒絕時(shí)如何處理:
- 先提交修改,再切換
git commit -all
git checkout target-branch
- 先儲(chǔ)存修改,在切換
git stash
git checkout target-branch
三、重置分支指針
//git stach (必要時(shí)先儲(chǔ)存)
git reset --hard abf12f4
四、在合并或者解決沖突時(shí)出錯(cuò),應(yīng)該撤銷合并:
git reset --merge