Git fetch vs checkout8/11/2023 ![]() ![]() Used when you need a single commit that is not at the tip of a branch, without pulling in all history of that branch. Note: If your depth is quite large, the server will have to do a lot of calculations increasing transfer time. For example if you know you need to build a feature branch (or your main branch) and you don't need all it's history! Potential huge data savings □. Really useful if you only care about the newest state of a certain branch. This flag restricts the history to the latest commits. Be careful though, some CI pipelines need tags, so double check if you need it. Tags are often version numbers such as Although not a huge data saver, it helps. The more active branches live on your remote, the bigger the benefit and with more than 400 active contributors in our repo, that helps! git fetch -no-tagsĪnother simple flag! This one omits the tags from the git history. This simple flag ( -single-branch) makes sure you only fetch the history of your main branch. You only need to checkout / build a single branch If we include the whole history (all branches on remote, all tags, full history), the size of our repo amounts to more than 1GB.ĭownloading that much data on each run is a waste of bandwith and time, so I've dived into the git documentation and found several possibilities that I will share with you. One of the big obstacles I had to overcome was dealing with the sheer size of our monorepo. ![]() Over the last week I've been working hard on migrating our Frontend Monorepo from a on-premise Jenkins pipeline to a cloud based solution. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |