Preventing some changesets from being pushed

Martin Geisler mg at lazybytes.net
Thu Aug 26 10:04:44 UTC 2010


Simon Robinson <thegreatelectron at yahoo.co.uk> writes:

> Is there a way of ensuring that some changes that I make in my local
> repository never get pushed to the source (central) repository?
>
> I'm working on a large project using mercurial for version control.
> The changes I make to the code get committed to my local repository
> and then pushed to the 'central' repository that is shared by all
> members of the team. However, I have a couple of configuration
> settings - things like connection strings to my private dev database -
> that I do not want to be pushed centrally. Is there any way to achieve
> that?
>
> I did consider putting the files containing the config settings in the
> .hgignore, but the trouble is, I might make other changes to those
> same files - like adding new settings - that I do want pushed. I
> really want to be able to ignore certain changesets when pushing
> rather than ignore certain files.

The way to solve this generic problem is not commit the changes you do
not want pushed.

You should instead put such configuration settings in a private config
file and add that to .hgignore. Then include that file from the main,
shared config file for the project.

-- 
Martin Geisler

Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20100826/2537535f/attachment.asc>


More information about the Mercurial mailing list