最近在刪除 Git 上的敏感資料
使用到 Git 的 ForcePush 產生錯誤訊息

git push origin HEAD:master –force

Alt text

 ! [remote rejected] HEAD -> master (TF401027: You need the Git 'ForcePush' permission to perform this action. Details: identity 'Windows Live ID\user@mail.com', scope 'branch'.)
error: failed to push some refs to 'https://xxxx@dev.azure.com/xxxx/xxxx/_git/project.xxxx'

看起來應該是權限不足
上去 Azure DevPos 找了一下設定

Alt text

點選 Manage repositories

Alt text

Force push (rewrite history, delete branches and tags) 設定為 Allow

PS.群組我選 Project Collection Administrators 視需求每人選的有所不同