![]() It suggests that branches are quite heavyweight objects.If anything, a branch is a “directed acyclic graph of development” rather than a line.Branches are often described as being a “line of development”, but I think that’s an unfortunate expression since: Branchesīefore I explain the advice about git pull any further it’s worth clarifying what a branch is. ![]() Of course, unless you turn off all the safety checks, the effects of a git pull on your working directory are never going to be catastrophic, but you might prefer to do things more slowly so you don’t have to backtrack. The other problem is that by both fetching and merging in one command, your working directory is updated without giving you a chance to examine the changes you’ve just brought into your repository. What seem like obvious bits of syntax for git pull may have rather surprising results, as even a cursory look through the manual page should convince you. Mostly things Just Work, but when they don’t it’s often difficult to work out why. The problem with git pull is that it has all kinds of helpful magic that means you don’t really have to learn about the different types of branch in git. ![]() One of the git tips that I find myself frequently passing on to people is:ĭon’t use git pull, use git fetch and then git merge. There is some discussion of this post on the git mailing list, but much of it is tangential to the points I’m trying to make here. This is too long and rambling, but to steal a joke from Mark Twain Blaise Pascal I haven’t had time to make it shorter yet.
0 Comments
Leave a Reply. |