Which is better to use and why? git format-patch or git bundle?

487 views Asked by At

I basically have 3 questions:

  1. Which is better to use and why? git format-patch or git bundle?
  2. What all metadata is used by GIT to calculate SHA-1 key for commit and blobs/trees?
  3. When I apply a patch which was created by format-patch, why does it have different SHA for same changes and commit?
1

There are 1 answers

1
umläute On
  1. this obviously depends on your use-case; git bundle only makes sense if you transfer a changeset from one git-repository to another, whereas git format-patch creates standard diff-files which can be inspected easily and applied to a non-gitified source tree as well. on the other hand git bundle creates a single file, which is easier to transport than the multi-file output of git format-patch

  2. this is possibly a duplicate of Is SHA-1 calculated based on content?

  3. see #2