Disable warning about detached HEAD

后端 未结 2 616
谎友^
谎友^ 2021-02-02 06:41

In git if you checkout a commit directly you get a big fat warning starting with:

\"You are in \'detached HEAD\' state. You can look around ...\"
2条回答
  •  不知归路
    2021-02-02 06:55

    Shamelessly copying mjs's comment to post it as an answer on its own:

    git -c advice.detachedHead=false checkout 
    

    The -c advice.detachedHead=false parameter will allow you to suppress the warning without having to change the global config. It will only apply to the executed command. Here's the list of all advises that can be suppressed.

提交回复
热议问题