I like to keep a file with some private data (links, etc) in the project that I’m working on. I liked to be versioned but not exportable (by push) to other repository.
Below is a more schematic description of my problem.
- I cloned a repository (r) to my repository (m)
- I added a file to my repository (m) that I do not want to push to initial repository (r) but I want it tracked in my repository (m). It’s a file where I keep links, etc.
- How can I push to initial repository (r) but ignoring the file from my repository (m)?
Mercurial pushes changesets, not files.
If you ask Mercurial to start tracking a file by adding it, and then committing it, it is now part of the history of the repository.
Pushing from this repository, will push that file as well.
Summary: Don’t do it, it can’t be done. Find a different way to handle this situation.