问题描述
我是版本控制的新手,所以我的问题很基础.我正试图将Mercurial用于此目的.我的Mac上有本地工作目录.我想使用Bitbucket备份此目录中的文件和存储库.
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.
将执行以下命令:
hg push localDirectoryWithRepo http://bitbucker.org/user_name/repo_on_bitbucket
也将文件传输到Bitbucket还是仅传输到存储库?
transfer my files also to Bitbucket, or only the repository?
我还尝试了以下命令:
hg clone localDirectoryWithRepo http://bitbucker.org/user_name/repo_on_bitbucket
但是,我得到了错误提示
however, I get the error saying
abort: cannot create new http repository
如何首先在bitbucket上克隆本地工作目录,然后在bitbucket上更新工作目录,使其与本地工作目录相同.
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.
一如既往,非常感谢.
推荐答案
Mercurial仅传输已提交的更改.它不会帮助您备份尚未准备好提交的工作副本. push
命令将远程仓库没有的所有提交的更改集发送给克隆命令,而clone命令将所有这些更改集发送(或获取)到没有仓库的位置,而bitbucket不支持创建新的仓库在结束时使用close.
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.
这篇关于在BitBucket上备份本地工作目录-克隆或推送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!