Can I disable git pull?

Can I disable git pull?

I guess the problems you refer to are merge conflicts that may happen if your local branch diverged from the remote. In that case, try setting pull.ff option in git config, like that:

[pull]
    ff = only

This will tell git to only do fast-forward merges, which are guaranteed to not result in conflicts.

 

 

https://git-scm.com/docs/git-config

pull.ff

pull.ff

By default, Git does not create an extra merge commit when merging a commit that is a descendant of the current commit. Instead, the tip of the current branch is fast-forwarded. When set to false, this variable tells Git to create an extra merge commit in such a case (equivalent to giving the --no-ff option from the command line). When set to only, only such fast-forward merges are allowed (equivalent to giving the --ff-only option from the command line). This setting overrides merge.ff when pulling.

 

merge.ff

By default, Git does not create an extra merge commit when merging a commit that is a descendant of the current commit. Instead, the tip of the current branch is fast-forwarded. When set to false, this variable tells Git to create an extra merge commit in such a case (equivalent to giving the --no-ff option from the command line). When set to only, only such fast-forward merges are allowed (equivalent to giving the --ff-only option from the command line).

 

上一篇:关于sql_mode=only_full_group_by问题的解决方法


下一篇:阿里面试官分享+真实面经+笔试模拟题 | 面试充电,就看这篇