I heard that if we are working on a feature and then we need to fix something quickly, we can make a temporary clone and then fix the bug, and push to the central repo.
First of all, is the temporary repo cloned from the central repo or from our local repo?
Also, is it good to clone 2, or 3 repos from the central repo to our hard drives, so if we are working on a feature using local repo 1, and need to make a quick bug fix, then we can go to local repo 2, do an hg pull
, hg up
, and make the bug fix, and hg push
and be done with the bug fix without affecting local repo 1?
So we will keep local repo 1, 2, 3 always there, so that we have them as standby, without needing to create a new temporary clone each time, which can be time consuming.
Update: I think one suggested practice from the answers is: clone from Central repo to local repo only once (and call this local repo as "master repo"), and then clone from this local repo "on demand", fix the urgent bug in the tmp repo, and push directly from tmp repo back to the Central remote repo? However, isn't it said that during development, we should commit often (even before the feature is totally finished and bug free), so if we clone from local repo to a tmp repo, won't the clone include those committed files as well? And what if the urgent fix require modifying the files that are in the local repo that are in "intermediate" state (in the middle of development)?