There are several allusions in the Torah that through divine inspiration the Patriarchs kept it entirely (see Yoma 28b based on Bereishit 26:5 for Abraham and Rashi on Bereishit 32:5 for Jacob). Yet, we see in Bereishit 35:14 that Jacob set up a pillar (מצבה) as a commemoration:
וַיַּצֵּ֨ב יַֽעֲקֹ֜ב מַצֵּבָ֗ה בַּמָּק֛וֹם אֲשֶׁר־דִּבֶּ֥ר אִתּ֖וֹ מַצֶּ֣בֶת אָ֑בֶן וַיַּסֵּ֤ךְ עָלֶ֨יהָ֙ נֶ֔סֶךְ וַיִּצֹ֥ק עָלֶ֖יהָ שָֽׁמֶן׃
And Jacob set up a pillar in the place where He spoke with him, a pillar of stone, and he poured out a drink-offering thereon, and poured oil thereon.
Rashi's commentary on the verse is rather misterious ("I do not know what this teaches us."), and doesn't discuss how is it possible that we read in Devarim 16:22:
וְלֹֽא־תָקִ֥ים לְךָ֖ מַצֵּבָ֑ה אֲשֶׁ֥ר שָׂנֵ֖א יְהוָ֥ה אֱלֹהֶֽיךָ׃
Neither shalt thou set thee up a pillar, which Hashem thy God hateth.
How is it possible to reconcile the two verses?