最近在使用版本庫軟件git的時候出現了問題,由於先是用coding的打包,可是coding打包不完全,後來使用sourcetree來打包,還不錯,可是換到linux下後 使用了命令行,怎麼用命令行打包呢?
百度搜索後發現如下命令不錯php
git archive
linux
個人蹩腳英文就不獻醜了你們到這個地方 http://git-scm.com/docs/git-archive 去看吧git
簡單的用法就是segmentfault
git archive --format zip --output /path/to/file.zip master # 將 master 以zip格式打包到指定文件
還有個更簡單的命令行
git archive v0.1 | gzip > site.tgz git archive master > /home/hainuo/fds.zip
還有一個增量的code
git archive develop $( git diff v1.1.8_beta13..v1.1.8_beta14 --name-only)|gzip >aaa.zip #比較兩個版本之間的差別文件,生成一個差別文件壓縮包
部分代碼來源 http://www.w3php.com/archives/45orm
關於git打包時出現亂碼的問題見問答
http://segmentfault.com/q/1010000002443403ip