Backup a local working directory on BitBucket - clone or push

送分小仙女□ 提交于 2019-12-11 09:16:04

问题


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:


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.



来源:https://stackoverflow.com/questions/4172174/backup-a-local-working-directory-on-bitbucket-clone-or-push

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!