When developing sites for SharePoint using solution deployment (WSP) you think about provisioning of masterpages and page layouts using features, like the one below:
<Module Name="MasterPages" Url="_catalogs/masterpage" Path="sourcefolder">
<File Url="CustomSite.master" Type="GhostableInLibrary">
<Property Name="Title" Value="Custom Site Masterpage" />
<Property Name="ContentType" Value="$Resources:cmscore,contenttype_masterpage_name" />
</Module>
But what happens when the site is deployed and you need to make changes to masterpages and page layouts ...
1. You cant create a feature like the one above with IgnoreIfAlreadyExists.
<Module Name="MasterPages" Url="_catalogs/masterpage" Path="sourcefolder">
<File Url="CustomSite.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE">
<Property Name="Title" Value="Custom Site Masterpage" />
<Property Name="ContentType" Value="$Resources:cmscore,contenttype_masterpage_name" />
</Module>
This fails with file already exists, even though the IgnoreIfAlreadyExists property is specified.
2. You can edit using SharePoint Designer, but if you don't have access to SharePoint Designer you are out of options.
3. You could upload these to the gallery in SharePoint if you have permissions.
4. You can use STSADM Export / Import but this will bring over all content. I prefer to make the deployment footprint as small as possible.
I decided to create a custom STSADM command which will modify the existing files or add new ones if they don't exist. The STSADM command is called "UploadMasterPagesAndPageLayouts" and accepts the following parameters

Here is an example of the usage:
STSADM -O uploadmasterpagesandpagelayouts -url http://intranet -folder "c:\deploy" -comment "uploaded by a tool" -version "major" -autoapprove
This will upload all files in the deploy folder to http://intranet as major versions and approved. The only optional parameter is the autoapprove flag, by default this is leave unapproved.
Download the extension here http://uploadplmp.codeplex.com/Release/ProjectReleases.aspx