28

Has anyone taken a local repo and imported it into Bitbucket? When I go to do this, the Import page asks for a URL, but I'm working on a local computer that does not have port 8000 open to the outside world.

Can I just use some special form of a file path?

César
  • 9,939
  • 6
  • 53
  • 74
Daniel Williams
  • 8,912
  • 15
  • 68
  • 107

1 Answers1

29

First you need to create a repository in Bitbucket, go to Repositories -> create repository. Then you can choose between HTTPS or SSH.

You can customize your hgrc file like this:

[ui]
username = Your Name <youremail@example.com>

[paths]
myproject = https://.. # The one provided by Bitbucket

Now you can just push your changes to the repository:

$ hg commit -m "my changes"
$ hg push myproject

Or pull changes:

$ hg pull -u myproject

The -u option will also update your local repository after pulling the changes. You can use this option instead of pulling and then updating your local repository. The -u option is the same as doing:

$ hg pull myproject
$ hg update

You may also want to take a look to the hgignore file.

César
  • 9,939
  • 6
  • 53
  • 74
  • Can you explain the importance of setting the myproject variable? The pushing seems to work even without it. – einpoklum Mar 12 '16 at 21:20
  • 1
    I created an empty HG repository on BB and then tried to push as you described but I'm getting an "abort: repository is unrelated" error. What am I missing? – Dan Berlyoung Aug 13 '18 at 16:18