! [remote rejected] branchA -> branchA (pre-receive hook declined)
error: 无法推送一些引用到 'gitlab.xxx.xxx.xxx/xxx.git'
原因推测:
你的commit不是当前分支最新的commit 或者是做了rebase操作造成的, 可以在本地删除有问题的分支,然后再新建刚刚删除的
解决方法
一:
1. git checkout -B onebranch-temp
2. git branch -D onebranch
3. git pull
4. git checkout onebranch
5. git branch -D onebranch-temp
6. git pull
7. git cherry-pick [git log --oneline中的哈希值]
8. git push
二:
1. git reset [hash], 再git push
2. git merge [主分支], 再git push
三:
git push -f