git强制拉取代码覆盖本地的

git reset --hard 3b2cbd856874a685d67216086233b9454ee84f27

撤掉已push的代码

git log -5   看下要撤回到哪个版本号  比如要撤回到  7a5a79083a4aaf56487c1acb9e05983a4b412200

git reset --hard 7a5a79083a4aaf56487c1acb9e05983a4b412200

git push origin tags/*** --force

强制撤回git线上仓库文件到aa138b14c0e59d0f94357f7537e97b01f796b2e2日志版本
git reset --hard aa138b14c0e59d0f94357f7537e97b01f796b2e2
强制推到develop分支 
git push origin develop --force
其它人员本地仓库的版本如果是aa138b14c0e59d0f94357f7537e97b01f796b2e2版本之后的  其它人员的本地仓库push时也需要先撤回到aa138b14c0e59d0f94357f7537e97b01f796b2e2版本
否则其它人员会把本地仓库aa138b14c0e59d0f94357f7537e97b01f796b2e2之后的再一并push到线上仓库  
其它人员本地仓库再push时不用加 --force了

其它情况

checkout后仍提示冲突  可以采用checkout -f
git checkout -f custom/ome/model/delivery.php

其它情况 git diff文件没有差异  不能git pull的

git status 提示

# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)

36>$ git status
# On branch dev
# Your branch is behind 'origin/dev' by 6 commits, and can be fast-forwarded.
#
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   custom/desktop/lib/finder/builder/prototype.php
#       modified:   custom/ome/controller/admin/order.php
#       modified:   custom/ome/lib/finder/extend/filter/orders.php
#       modified:   custom/ome/model/orders.php
#       modified:   custom/ome/view/admin/order/order_copy.html
#
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   app/base/kernel.php
#       modified:   app/base/model/queue.php

可以按照提示操作

git reset HEAD custom/desktop/lib/finder/builder/prototype.php
git reset HEAD custom/ome/controller/admin/order.php
git reset HEAD custom/ome/lib/finder/extend/filter/orders.php
git reset HEAD custom/ome/model/orders.php
git reset HEAD custom/ome/view/admin/order/order_copy.html

###然后

git checkout origin/dev custom/desktop/lib/finder/builder/prototype.php
git checkout origin/dev custom/ome/controller/admin/order.php
git checkout origin/dev custom/ome/lib/finder/extend/filter/orders.php
git checkout origin/dev custom/ome/model/orders.php
git checkout origin/dev custom/ome/view/admin/order/order_copy.html

###然后
git pull即可

 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值