![]() ![]() ![]() We don’t want future developers to have to choose between Bob’s changes and yours. Hopefully it’s obvious why this is a problem. Mercurial has no problem letting your local repository have multiple heads, but it expects you to resolve the situation before pushing changes elsewhere. ![]() If you were allowed to push your changes, the central repository would end up in the same state that your local repository is now in… with multiple heads on the ‘default’ branch. Right now, the central repository only has three commits (the first two, plus Bob’s) and a single head. The ‘default’ branch now has two “heads” (thus the “multiple heads” warning when you tried to push your changes). See that split in the repository graph? Your changes (“Third commit.” and “Fourth commit.”) are on one path, and Bob’s commit appeared on a separate path. After doing so, your commit graph looks something like the following: ![]() (Let’s blame it on your freakishly productive co-worker, Bob.) To better visualize the state we’re in, let’s pull those changes down to your local repository. This means someone else has pushed new changes to the central repository before you did. You finish the changes you’ve been working on, and commit them to your local repository (the third and fourth commits in the following screenshot).īut when you go to push your new commits to your team’s central repository, Tortoise stops you with message saying you shouldn’t create “multiple heads” in the remote repository. You’re working in your local repository, and there have already been a few commits that you’ve pulled in from the central repository (two, in the screenshot below). How We End Up in This Situation (or, “It’s All Bob’s Fault”)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |