问题
Using git archive commmand is it possible to download only the changed/affected files from a repository for a particular commit id ? Is it possible using the web interface @ bitbucket ?
回答1:
List the files changed in a commit with git diff-tree and pass them to the command line of git archive.
git archive --format=zip --output=commit_files.zip <tree-ish> `git diff-tree --no-commit-id --name-only -r <tree-ish> | sed ':a;N;$!ba;s/\n/ /g'`
回答2:
You can create an archive file focused on a specific commit, but it archives the entire repo, not just the changed/affected files. You could probably figure those out by the log though.
Example: if you wanted the latest changes from bitbucket it would look something like:
git archive -format=tar --remote=<PATH_TO_YOUR_REPO> HEAD
来源:https://stackoverflow.com/questions/12073559/is-it-possible-to-download-only-files-changed-in-a-commit-revision-using-git-arc