我从 master 分出来 develop 分支做开发,今天要测试一个功能 又从 develop 出了个分支 test,没想到两个分支的 哈希 竟然一模一样
test
提交: e033e8a69384bf228d3d78ba486b4841ce2d3320 [e033e8a]
父级: ce67fb224a
develop
提交: e033e8a69384bf228d3d78ba486b4841ce2d3320 [e033e8a]
父级: ce67fb224a
而且即便我删除了再重新创建分支也会是一样的 哈希,这是什么情况啊?
过去多啦不再A梦2017-05-02 09:20:27
Git is not svn, creating a branch will not completely copy a snapshot. Git just creates a pointer test, pointing to the same location as develop.
The hash value in git is the hash value of each commit, and branches have no hash value. Because there are no new commits after the test is created, they still refer to the same commit, so naturally they have the same hash value.