git clone, ignoring a directory

后端 未结 4 1615
名媛妹妹
名媛妹妹 2020-11-30 03:31

I\'m trying to test something on a wordpress install. In doing so, I\'d like to quickly replicate the repo. However, the upload directory (wp-content/uploads) i

4条回答
  •  春和景丽
    2020-11-30 04:24

    git clone will always clone the complete repository*, including all previous commits ever added to the repository. So even if you remove the files temporarily, and clone it then, you will still receive the older versions which do contain those files.

    Also, just editing the .gitignore will not remove tracked files from the repository even if they would normally be ignored.

    So no, it is not really possible to skip a certain folder during cloning.

    *It is possible to limit the amount of commits retrieved during a clone, but this will not make the repository very usable.

提交回复
热议问题