This is the critical design change presented by partial clone. These days, many developers always have a network connection available as they work, so asking the server for a little more data when necessary might be an acceptable trade-off. Likely, the historical data forms a majority of your data. This diagram is purposefully simple, but if your repository is very large you will have many commits, trees, and blobs in your history. The root tree at the HEAD commit is fully expanded underneath, while the rest of the trees have arrows pointing towards these objects. The arrows between a commit and its parents therefore go from right to left. In this diagram, time moves from left to right. This includes every tree and blob in the entire commit history! We can now describe the data downloaded by a git clone command! The client asks the server for the latest commits, then the server provides those objects and every other reachable object. The process of following these arrows is sometimes referred to as walking objects. If we can follow a list of arrows from an object A to another object C, then we say C is reachable from A. Basically, if an OID B appears inside a commit or tree A, then the object A has an arrow to the object B. We use arrows to represent a relationship between objects. They are helpful for some build environments where the repository will be deleted after a single build.Īs we discuss the different clone types, we will use a common representation of Git objects: These clones also put undue stress on later fetches, so they are strongly discouraged for developer use. This creates some unexpected behavior issues, limiting which Git commands are possible. These clones truncate the commit history to reduce the clone size. git clone -depth=1 creates a shallow clone.These clones are best for build environments where the repository will be deleted after a single build, but you still need access to commit history. These clones download all reachable commits while fetching trees and blobs on-demand. git clone -filter=tree:0 creates a treeless clone.These clones are best for developers and build environments that span multiple builds. These clones download all reachable commits and trees while fetching blobs on-demand.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |