Backup a local working directory on BitBucket - cl

2019-08-12 09:30发布

I am very new to version control, so my questions are very basic. I am trying to use Mercurial for the purpose. I have a local working directory on my mac. I want to use Bitbucket to backup the files and the repository in this directory.

Will the following command:

hg push localDirectoryWithRepo http://bitbucker.org/user_name/repo_on_bitbucket

transfer my files also to Bitbucket, or only the repository?

Also, I tried the command:

hg clone localDirectoryWithRepo http://bitbucker.org/user_name/repo_on_bitbucket

however, I get the error saying

abort: cannot create new http repository

How do I clone a local working directory on bitbucket initially and then update a working directory on bitbucket, so that it is the same as my local working directory.

As always, thanks a ton.

1条回答
家丑人穷心不美
2楼-- · 2019-08-12 09:49

Mercurial only transfers committed changes. It will not help you backup working copies you aren't ready to commit. The push command sends every committed changeset the remote repo doesn't have and the clone command sends (or gets) all of them to a location that doesn't already have a repo -- and bitbucket doesn't support creating new repos on their end using close.

Commit early. Commit often. Push often.

查看更多
登录 后发表回答