How do you push to a new repository?

Hello! I recently stumbled on BitKeeper, and although I know it’s not actively maintained right now, I fell in love with it and have been using it for some small personal projects.

Pretty much every question I’ve had has been answered in the docs, but there was one particular thing I got completely stuck on: say I want to push my repo to a fresh directory, or to a server over ssh. With git, I’d create a directory at the proper location, git init --bare inside, and then do a push.

With bk, I can’t seem to figure it out. My first thought was:

  • Create an empty directory.
  • bk setup (with -P if a product repo).
  • bk level the-local-repository-level if the local repo’s level != 1
  • In the local repository, bk push the-new-directory

However, then I get:

You are trying to push to an unrelated package.
Please check the names and try again.

I’m guessing there’s some trick to this, but I’m not sure what it is right now and can’t find anything on it in the docs. What would be done here? I know that I could just cp/scp the entire current repository onto the host, but that feels a bit like a hack.

In bk every repository is a clone of so other repository and related. So you can’t create a new repository and then push to it.

What you need to do is clone your local repository to the server.

Usually something like this:

bk clone myrepo HOST:bk/myrepo   # clone local repo to server using SSH
cd myrepo
bk parent  -s HOST:bk/myrepo     # change the default URL for furture pulls/pushs

see ‘bk help url’ or possible URLs.

Another option is to start a bkd on the repo server (bk help bkd), make sure you can connect to the TCP port and then push with a bk://HOST:PORT/PATH type URL

1 Like

Ah, thanks! I wasn’t aware that cloning onto a remote could be used for this.