Is it possible to download ONLY files changed in a

2019-05-13 21:54发布

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 ?

标签: git bitbucket
2条回答
爷、活的狠高调
2楼-- · 2019-05-13 22:27

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'`
查看更多
该账号已被封号
3楼-- · 2019-05-13 22:44

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
查看更多
登录 后发表回答