Question

I have a local project with hg init. I created an empty remote repo at bitbucket.org. The url is for example https://bitbucket.org/myusername/helloworld. I want it as a bare remote repo without working directory.

According to the instruction at Bitbucket while creating a new rep, I could upload my local repo to the remote repo using hg push, but it is containing the working directory.

cd \path\to\myproject
hg push https://myusername@bitbucket.org/myusername/helloworld

How can I create a bare remote repo which is a clone of my local project (repo)?
And can I do sync/push/pull with the bare remote repo without working directory?

Was it helpful?

Solution

I think there's some confusion here. All repos at bitbucket are "bare" (not really a mercurial term). You can't see the working directory at bitbucket (it's on their servers), so if you're concluding that your repo at bitbucket is "bare" you're looking at the wrong thing or misunderstanding what the term means.

Your local repo could be called "bare" if the local working directory has no files. You can see what that looks like by doing hg update null. You can get files back in your working directory by doing hg update. But bare/non-bear only makes sense when you're talking about a clone to which you have disk access. When you follow those bitbucket steps above you're creating an "empty" repository at BB w/ no changesets in it, and then the hg push moves those changesets (aka commits) over there. Afterward, it's no longer empty, but it's still "bare".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top