Pulling safely

The fetch that happens first, and the three ways your commits and theirs can be combined.

Pulling is two operations that Git spells as one: fetch what the remote has, then combine it with what you have. Innesta always does the first, and reads the two histories to decide how to do the second.

The preventive fetch

A pull always fetches first. That sounds obvious and is not what a bare git pull necessarily does with every configuration — and it matters, because deciding how to combine two histories requires knowing what the other one actually is right now.

The three ways to combine, and which one you get

Innesta picks. There is no strategy to choose beforehand, and no preference that settles it: the choice comes from what the two branches actually contain.

Fast-forward. Your branch has nothing of its own, so the remote’s commits simply move you along. Nothing to decide, nothing to conflict. If it is the other way round — you are ahead and they have nothing new — the pull has nothing to do and does nothing.

Rebase. Both sides have moved: your commits are replayed on top of the remote’s, and the history stays linear. This is the ordinary case.

Merge. Your commits and theirs are joined by a merge commit. Nothing is rewritten, and the history records that the two lines existed. Innesta falls back to this rather than rebasing when replaying would lose something — when your own commits already include a merge, or when one of them carries a tag the remote has not seen.

And the autostash under all three. If uncommitted work is in the way, Innesta stashes it first, integrates, and puts it back, which is what makes a pull workable in the middle of a change rather than only on a clean tree.

What blocks a pull

Untracked files that the incoming commits would overwrite. Git refuses, because those files have no history and overwriting one destroys it with no way back.

Innesta says exactly that rather than reporting a generic failure, and offers a way through: a dialogue headed Untracked Files Block This Update, with Stash & Continue. That moves the blocking files into a stash, completes the update, and puts them back. Anything it cannot put back stays in the stash, where you can still get at it.

If it conflicts

The files Git could not settle are marked, and the three-pane editor is where you settle them. A pull that has stopped mid-conflict has not lost anything, and it can be abandoned.