Git: Checkout only files without repository?

前端 未结 6 1513
故里飘歌
故里飘歌 2020-12-13 04:31

i\'d like to just checkout the files without the .git files and the whole repository. It\'s because i\'d like to manage a website (php & html) with git and i\'m looking

6条回答
  •  忘掉有多难
    2020-12-13 04:52

    Git is much easier than Subversion for this, as the whole repository is held in a single directory. You only need to delete the hidden ".git" folder in the root of the project to create a production-ready copy of your site.

    In Linux/OSX this would be:

    mkdir dist && cd dist
    git checkout --depth=1 http://path/to/your/project.git
    rm -rf .git
    

提交回复
热议问题