Iguy
Iguy

Reputation: 711

How can I import a pre-existing git repository into Bluemix?

We have a Git repository stored in our local network that we've been using for the last 6 months. We want to shift (upload) this repository to Bluemix for use in a jazz.net project.

It's necessary that we retain the history in our repository. It's also necessary that the uploaded repository not be on Github (we want it only on jazz.net)

We've tried a number of things:

We linked our local Git repository to a public Github repository. Then (of course) as soon as we delete that repository from Github (since we only want it on Jazz) we lose the other side of the link.

We created a new repository. That has the initial commit in it, problem one. Problem two we lose the history that we want to retain by cloning that one copying the work from our local repository into it.

Are there other options that will allow us to use our local git repository on Bluemix as a Jazz project

So how can we use our local Git repository on Bluemix without losing the history?

Thanks.

Upvotes: 2

Views: 394

Answers (1)

Iguy
Iguy

Reputation: 711

We are able to set up a new DevOps Services project with an existing Git repository by:

  • Creating a new project from the 'My Projects' page on Bluemix DevOps Services
  • Creating a new Git repository for our new project.
    • Do not select "Initialize the repository with a README and license template."
    • Select or clear the other project options as needed.

(this is the key)

  • We then get into a command-line window and change to the directory of our pre-existing Git repository.

We push the contents of the repository by typing these commands:

git remote add new_repo https://hub.jazz.net/git/your_alias/project_name

git push -u new_repo master

This let us take our local Git repository and upload it for use on Bluemix with its history intact.

Upvotes: 5

Related Questions