Using Git and Mercurial repo for same project doesn't certainly sounds appealing, as, somebody asked me about the idea of using both these greatest SCMs available at this moment to use for the same project, inside the same folder. The idea sounds fascinating, but its such a noob question to DVCS, and the guy had obviously the monotonic SVN background. The problem is not in the tools for development, the problem lies when people starts coying an idea to use all of the available tools in same project which might not be necessary, or just extends the problems/ delays the development. It is certainly good to have knowledge of both SCMs but not using these SCMs in same project is like having better knowledge. Git and Mercurial has both Pros and Cons among each other, but both tools are great in comparison to old VCSs like SVN, with Git taking a bit upper hand in the market due to its growing support and offers of public repos from some hubs. Nevertheless, Mercurial is somewhat identical to Git and as good as it, if not better.
One can certainly use both tools at the same time for the same project, but you have to be ready to manually fix lots of issues when it comes to merging the branches. The branching system of these SCMs are quiet different and once made change in one, it will definitely cause conflicts in other, so, solving these issues would obviously make you better version control specialist, but might take your time from production and would cause delay. So, which among these tools I'd recommend using ? Sorry, no recommendation, I use these tools very frequently and I have never come up with big occasion to select one over other. Even using the CLI both of these tools have identical commands, so, I'd say its pretty easy to switch between each other. Feel free to try.
Now, how to use Git and Mercurial repo for same project ?
Answer: Just by adding the ignore files.
Go to the project folder in command line
Now Initialize both the repos there
git init hg init
Now before adding the files and folders to be tracked by Git and Mercurial, lets add the ignore files
kate .gitignore // List all the files and folders you want Git to ignore, specially hg files and folders .hg .hg/* .hgignore
Now, do the same with Mercurial
kate .hgignore // List all the files and folders you want Mercurial to ignore, specially git files and folders .git .git/* .gitignore
Now your both repos in different SCMs are up and running. Be careful, as you are going to have tough time fixing conflicts/issues, so, Good Luck with it !!!