Git: How to make outer repository and embedded repository work as common/standalone repository?

前端 未结 6 1483
一生所求
一生所求 2020-12-05 09:59

I have a big project(let\'s say A repo), and it there one child folder which is come from B repo. I would meet warning like below when I commit fr

6条回答
  •  孤城傲影
    2020-12-05 10:42

    You can use below commands to add files from test2 repo to test repo as below:

    # In local test repo
    rm -rf test2
    git clone https://github.com/eromoe/test2
    git add test2/
    git commit -am 'add files from test2 repo to test repo'
    git push
    

    Note:

    You should use git add test2/ (with slash, not git add test2).

    git add test2/ will treat test2 folder and it's files as ordinary folder and file for test repo (create mode 100644).

    git add test2 will treat test2 folder as a submodule for test repo (create mode 160000).

提交回复
热议问题