ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

TortoiseGit中known changes与unknown changes区别

2022-04-15 00:33:14  阅读:306  来源: 互联网

标签:TortoiseGit unknown push known force changes remote


示例

image

官方介绍

known changes - This allows remote repository to accept a safer non-fast-forward push. This can cause the remote repository to lose commits; use it with care. This can prevent from losing unknown changes from other people on the remote. It checks if the server branch points to the same commit as the remote-tracking branch (known changes). If yes, a force push will be performed. Otherwise it will be rejected. Since git does not have remote-tracking tags, tags cannot be overwritten using this option. This passes --force-with-lease option of git push command.

unknown changes - This allows remote repository to accept an unsafe non-fast-forward push. This can cause the remote repository to lose commits; use it with care. This does not check any server commits, so it is possible to lose unknown changes on the remote. Use this option with Include Tags to overwrite tags. This passes the traditional --force option of git push command.

unknown changes等价于--force,强行提交时,可能覆盖团队成员在此期间推送的所有更改。
known changes等价于--force-with-lease,使用此参数推送,如果远端有其他人推送了新的提交,那么推送将被拒绝。该命令解决的是本地仓库不够新时,依然覆盖了远端新仓库的问题,如果执意想要覆盖远端提交,只需要先 fetch 再push,它也不会拒绝的。

标签:TortoiseGit,unknown,push,known,force,changes,remote
来源: https://www.cnblogs.com/2yue/p/tortoisegit_force.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有