![]() | * | 6fcbad87d4 rebase docs: fix incorrect format of the section Behavioral Differences ![]() * | 5335669531 Merge branch 'en/rebase-consistency' | * ac0edf1f46 range-diff: always pass at least minimal diff options * 965798d1f2 Merge branch 'es/format-patch-range-diff-fix-fix' With the Git repository for Git, however: $ git log -graph -oneline master If we use -depth 3 we'll pick up the tip commit cf68824, its parent 7c2376b at depth 2, and finally 95c8270 at depth 3-and then we stop, with three commits. * 80b88a5 add ruby gems directory to path * 26a9cc3 vimrc: fiddle with netrw directory display Suppose we have a commit graph that looks like this: $ git log -graph -oneline master The important point here is that the walk visits all parents of each commit, which-for each depth level-is more than one commit if the commit itself is a merge. As the documentation you quoted mentions, it also implies -single-branch, which simplifies talking about this. The -depth parameter refers to how deep Git goes on a "walk" from each starting point. (At work I observed the same thing with a GitLab server, so it can't be an artifact of how GitHub works.)ĭoes anybody know what is going on? How does the value for depth correspond to the actual amount of data downloaded? Do I understand the documentation wrongly, or is there a bug?Īs Jonathon Reinhart commented, you're seeing the effect of merges. |-|-|-|įor cloning I used this command git clone -depth 10, git clone -depth 100, and for counting the commits I used this git log -oneline | wc -l. This is what I got when I tried different values for depth: | depth | commit count linux repo | commit count git repo | This would indicate that will equal the number of commits that will be fetched during the clone, but it's not the case. If you want to clone submodules shallowly, also pass -shallow-submodules. single-branch unless -no-single-branch is given to fetch the histories near the tips of allīranches. This is what help for git clone says about it: -depth Ĭreate a shallow clone with a history truncated to the specified number of commits. I did some experiments with -depth parameter for clone and encountered some weird behavior. Rewriting git's history just to get rid of them seems like too much trouble, so we figured doing a shallow clone that avoided those big early commits would be good enough. ![]() Somebody committed some huge (by git's standards) binaries early in the project's life. We tried to speed up the CI build of one of our software projects at work.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |