how can I add git submodule into git repo as normal directory?

前端 未结 2 1273
暖寄归人
暖寄归人 2021-02-10 12:18

Let\'s see what it is

  • Create two git repo sub & test
mkdir test sub
cd test && git init && touch R         


        
2条回答
  •  别跟我提以往
    2021-02-10 12:59

    Seems you cannot do that. The name .git is hard-coded in the source code: https://github.com/git/git/blob/fe9122a35213827348c521a16ffd0cf2652c4ac5/dir.c#L1260

    Probably one way is to make a script which renames .git to something else and back before and after adding it into repo like

    In working directory under scripts

    mv .git hidden-git
    

    In Dockerfile

    RUN mv $JENKINS_HOME/scriptler/scripts/hidden-git     
    $JENKINS_HOME/scriptler/scripts/.git
    

    Alternatively, probably it's possible to pass GIT_DIR environment variable into the plugin, so it could use another name.

提交回复
热议问题