Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从windows中删除git pull消息_Git_Bash_Github - Fatal编程技术网

如何从windows中删除git pull消息

如何从windows中删除git pull消息,git,bash,github,Git,Bash,Github,当我在Ubuntu上键入git pull origin master时,它会将远程存储库中的更改拉入本地存储库,并且工作正常 但是,如果我在Windows上这样做(使用git bash),它会将更改作为合并提交(就像我接受拉请求一样)。因此,即使我只是更新我的本地存储库,下一次推送它时,拉式提交也会在那里 有没有办法从Windows中删除此行为?我希望它像Ubuntu一样,拉取不会导致新的提交。git-pull等于git-fetch加上git-merge,除非它是快进的,不需要合并,或者您已经配

当我在Ubuntu上键入
git pull origin master
时,它会将远程存储库中的更改拉入本地存储库,并且工作正常

但是,如果我在Windows上这样做(使用git bash),它会将更改作为合并提交(就像我接受拉请求一样)。因此,即使我只是更新我的本地存储库,下一次推送它时,拉式提交也会在那里


有没有办法从Windows中删除此行为?我希望它像Ubuntu一样,拉取不会导致新的提交。

git-pull
等于git-fetch加上
git-merge
,除非它是快进的,不需要合并,或者您已经配置了
pull.rebase=true
,在这种情况下,会执行一个rebase而不是合并

因此有两种可能性:

  • 您在Windows中有本地提交,但在Ubuntu中没有。然后,执行
    git-fetch
    和可选的
    git-rebase
    (但是要注意
    rebase
    规则!)
  • 你的Ubuntu配置了
    pull.rebase=true
    ,但没有Windows
  • 无论如何,我的建议是不要做git-pull。相反,只需执行git fetch,从那时起,您需要什么就做什么


    PS:类似的事情曾经发生在我身上,这是因为在Windows中我有两个额外的私有提交(以使项目适应Windows的怪癖)。因此,当执行<代码> Git拉< /代码>时,这两个提交正好在中间。我做了
    git config pull.rebase true
    ,问题就解决了。

    git pull
    等于
    git fetch
    加上
    git merge
    ,除非它是快进的,不需要合并,或者您已经配置了
    pull.rebase=true
    ,在这种情况下,会执行一个rebase而不是合并

    因此有两种可能性:

  • 您在Windows中有本地提交,但在Ubuntu中没有。然后,执行
    git-fetch
    和可选的
    git-rebase
    (但是要注意
    rebase
    规则!)
  • 你的Ubuntu配置了
    pull.rebase=true
    ,但没有Windows
  • 无论如何,我的建议是不要做git-pull。相反,只需执行git fetch,从那时起,您需要什么就做什么

    PS:类似的事情曾经发生在我身上,这是因为在Windows中我有两个额外的私有提交(以使项目适应Windows的怪癖)。因此,当执行<代码> Git拉< /代码>时,这两个提交正好在中间。我做了
    git config pull.rebase true
    ,问题就解决了