bitbucket, “hg push” and “hg update”

后端 未结 4 1594
旧时难觅i
旧时难觅i 2021-02-01 22:14

If I start out with a local mercurial repo, which I consider to be the \"main\" repo (pardon me my dvcs lords), and intend to use bitbucket as a backup and issue tracking facili

4条回答
  •  闹比i
    闹比i (楼主)
    2021-02-01 22:51

    Bitbucket shows you the repository. As pointed out by Dave Webb, hg update is concerned with updating the working copy. When you do hg push you are transferring changesets in order to update the repository on Bitbucket -- and so the webinterface will show this.

    There are no working copies on Bitbucket, as pointed out by Steve Losh. There is also no hg update being done behind your back.

    You can experiment with this yourself by making a clone without a working copy:

    % hg clone --noupdate repo repo-empty
    

    then go into repo-empty and do hg log. You will see that even though there are no files there, the history (i.e., the repository) has still been cloned. You can make the files appear with the hg update command:

    % hg update
    

    and disappear again with

    % hg update null
    

    The working copy is only needed if you want to look at the files and make new commits. Otherwise you can remove it to save space. This is normally done in clones that are only used for serving with hg serve or the equivalent thing that Bitbucket uses.

提交回复
热议问题