diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index ce6ef8971a..5c66447973 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -811,6 +811,9 @@ ${@buildhistory_get_metadata_revs(d)}
 END
 
 	( cd ${BUILDHISTORY_DIR}/
+		# Ignore system git config for local operations so host hooks or
+		# helpers absent from HOSTTOOLS cannot break buildhistory.
+		export GIT_CONFIG_NOSYSTEM=1
 		# Initialise the repo if necessary
 		if [ ! -e .git ] ; then
 			git init -q
@@ -833,10 +836,12 @@ END
 			buildhistory_single_commit "$CMDLINE" "$HOSTNAME" dummy
 		else
 			buildhistory_single_commit "$CMDLINE" "$HOSTNAME"
-		fi
-		if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then
-			git push -q ${BUILDHISTORY_PUSH_REPO}
 		fi) || true
+	if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then
+		# Keep system git config enabled for push (proxies, CAs, credentials).
+		( cd ${BUILDHISTORY_DIR}/
+			git push -q ${BUILDHISTORY_PUSH_REPO} ) || true
+	fi
 }
 
 python buildhistory_eventhandler() {
