Git Pills – Blindly pull considered harmful

In last pill, I exposed a way to push and pull in one shot using a sort of git sync command; this approach generated a very interesting discussion on Google+, and I think that is worth to write a post about it.

I published that pill in the Google+ Git Community and I quickly received some great feedback by +Yuri Khan, that pointed me out abut the risk to “blindly pull” from a remote branch.
As all we know, a git pull is basically a git fetch + git merge; if you pull a remote branch, you silently accept all the commits that comes from that branch, with all the possible issue deriving from a merge.
In the team I work (4-5 people at most, in the same office), we usually do code reviews before pushing local branches to the shared remote one (we use Git Flow workflow), so consequential pulls are usually safe, but this can be harmful in other scenarios (even in my scenarios, in effect).
So +Yuri (and even +Thomas) invited me to be more prudent, and as I really appreciated their suggestion, I want to share it with you.
Here the link at the complete discussion, happy reading!

Nando :)

Leave a Reply

Your email address will not be published. Required fields are marked *