How do I set up a git repository?

Asked by Darren Hoyland

Great to see that LP now supports git. So much so that we'd like to port our codebase over to git from bzr. Unfortunately, I'm a little confused on how to do it, as the instructions at https://help.launchpad.net/Code/Git seem to be missing some key information.

I have a bzr repo which lives in a place something like this: lp:~<team>/<team>/<name-of-private-repo>/

I wish to convert the repo to git, so as specified in the 'Converting from bzr to git' section, I did the following:

$ cp -r trunk/ master
$ cd master
$ git init .
$ bzr fast-export
$ bzr fast-export --export-marks=../marks.bzr | git fast-import --export-marks=../marks.git
$ git add .
$ git ci -m "conversion to git"
$ rm -rf .bzr

And it's at this point that I'm not sure how to proceed.

I've already added the following to my ~/.gitconfig:

[url "git+ssh://<email address hidden>/"]
        insteadof = lp:

[url "git+ssh://<email address hidden>/~autonomouse/+git/"]
        insteadof = lpme:

So how do I get the new git repo onto Launchpad?

Do I push back to the same repo?
$ git push --set-upstream lp:~<team>/<team>/<name-of-private-repo>/ master

Trying this gives me "fatal: remote error: '~<team>/<team>/<name-of-private-repo>' is not a valid Git repository path."

Was I supposed to push to a new subfolder?
$ git push --set-upstream lp:~<team>/<team>/<name-of-private-repo>/master master

I get the same "fatal: remote error: '~<team>/<team>/<name-of-private-repo>/master' is not a valid Git repository path."

Or am I supposed to set up a new repository for the git code? But attmepting to do so presents no option for specifying the new repo as a git repo. Besides, this isn't what I want to do - I want to convert the existing repo over to git.

I've also tried with a test repo but got "fatal: remote error: Project '+junk' does not exist."

Please advise.

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Darren Hoyland
Solved:
Last query:
Last reply:
Revision history for this message
Colin Watson (cjwatson) said :
#1

None of the URL forms you're attempting here are valid Launchpad Git URL forms per https://help.launchpad.net/Code/Git. What you need is:

  git push --set-upstream lp:~<team>/<team>/+git/<name-of-private-repo>

Also, +junk was a terrible name for Bazaar and we avoided replicating that mistake for Git. +junk essentially denotes personal branches; for Git, personal repositories are ~OWNER/+git/REPOSITORY-NAME.

Revision history for this message
Colin Watson (cjwatson) said :
#2

I meant to say:

  git push --set-upstream lp:~<team>/<team>/+git/<name-of-private-repo> master

... but hopefully the bit you actually needed was the URL correction.

Revision history for this message
Darren Hoyland (autonomouse) said :
#3

That was it. I'm not sure why I didn't see that section. Anyway, problem solved, thanks!

(and yes, +junk was a terrible name!)