The script is a little outdated but here's how it worked: You'd use the script either to push local changes or commit AND push local changes. The latter behaviour I got rid of in newer versions of the script because it should have a single responsibility. Before running the build, it would pull from remote, clone the whole repo, run the build from this clone then push. If changes are pushed by someone else in the meantime, the push will simply fail. If you make changes in your repo in the meantime, theses changes are unknown to the clone.
Here's the version I use everyday now https://github.com/dgageot/dotfiles/blob/master/bin/git-build
Hope this helps.