Honey Honey - 2 months ago 5x
Git Question

What happens if I cancel a 'pull remote changes' midway?

I am just pulling from remote in Xcode.

It has been fetching changes for 15 minutes now ( the 'fetching changes' is still spinning)...for what it normally takes 5-30 seconds. I don't know if there is anything wrong or what. My internet speed is flawless.

Would I break anything if I cancel? ie get a messed up code. Does that ever happen? Is the process atomic?


Doing a git pull is the same as doing as git fetch followed by a git merge. The latter merge operations takes place completely locally between a local branch and its corresponding tracking branch, and it is not relevant to your actual question.

With regard git fetch, this blog appears to state that Git operations, presumably including git fetch, are atomic:

Git is known to have atomic operations i.e. an environment issue will not cause git to commit half of the files into the repository and leave the rest.

Assuming this to be accurate, then either a remote tracking branch will be completely updated during a git fetch, or it will remain as it was.