$ git log
commit 9a466c572fe88b195efd356c3f2bbeccdb504102
Author: Scott Chacon <kody@gmail.com>
Date: Wed Mar 1007:34:102010-0800
second commit
commit b1ec3248f39900d2a406049d762aa68e9641be25
Author: Scott Chacon <kody@gmail.com>
Date: Wed Mar 1007:34:012010-0800
first commit
$ git clone repo.bundle repo
Cloning into 'repo'......
$ cd repo
$ git log --oneline
9a466c5 second commit
b1ec324 first commit
如果在打包时没有包含 HEAD 引用,还需要在命令后指定一个 -b master 或者其他被引入的分支,否则 Git 不知道应该检出哪一个分支。
现在假设提交了 3 个修订,并且要用邮件或者U盘将新的提交放在一个包里传回去:
$ git log --oneline
71b84da last commit - second repo
c99cf5b fourth commit - second repo
7011d3d third commit - second repo
9a466c5 second commit
b1ec324 first commit
$ git bundle verify ../commits.bundle
The bundle contains 1 ref
71b84daaf49abed142a373b6e5c59a22dc6560dc refs/heads/master
The bundle requires these 1 ref
9a466c572fe88b195efd356c3f2bbeccdb504102 second commit
../commits.bundle is okay
$ git log --oneline --decorate --graph --all
*8255d41(HEAD, master) third commit - first repo
|*71b84da(other-master) last commit - second repo
|* c99cf5b fourth commit - second repo
|*7011d3d third commit - second repo
|/*9a466c5 second commit
* b1ec324 first commit