简体   繁体   中英

Symfony 2 deploy git files

I want to upload files to my server and question is: what should I do with git repos (bundles) in my project?

Currently my project is 100 Mb, so my second question is why it is so big, if I have removed log and cache files.

I want to cleanup project. I don't want to upload .git files.

I generally find it useful to keep the repository files on the server as it helps tracking which version is online and tends to make updates easier, unless you build packages for your application. 100M is not that much on most hard drives anyway.

If you really want to upload the files alone, without the git repository information, you can simply clone your application elsewhere and strip out all git files.

From the root, you can run:

find . -name .git | xargs rm -Rf

I use Apache Ant to deploy using a zip file that I later unzip. By default ignores .git directory. The other cool thing is you can ignore other directories like nbproject (if your´re using Netbeans). The task I looks somethin like this

    <zip destfile="${migration.dir}/${migration.dir.suffix}_${operation.date}_${operation.time}.zip">
        <zipfileset dir=".." prefix="${migration.release.name}">        
            <exclude name="**/tests/**" />
            <exclude name="**/*.old*" />
            <exclude name="**/nbproject/**" />
            <exclude name="**/development-bundle/**" />
            <exclude name="**/*.bat" />
            <exclude name="**/_config/**" />
            <exclude name="**/bin/**" />
            <exclude name="**/.settings/**" />
            <exclude name="**/.project" />
            <exclude name="**/Thumbs.db" />
        </zipfileset>
    </zip>

You should read some documentation about it which is available on the symfony2 site.

In particular:

Regards,
Matt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM