Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can I import a local (no url address) git project into bitbucket?

Xavier Boucher
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 15, 2022

Can I import a local (no url address) git project into bitbucket?

1 answer

1 vote
Craig Castle-Mead
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2022

Hi Xavier,

I assume this means you're running a git server on your local machine and want to move that repository to Bitbucket?

If so, you cannot use Bitbucket's UI based import function (unless you're also running Bitbucket on the same machine, but I'm assuming this is not the case). 

But if you run the below commands on the machine running the git repo you want to move, the clone will give you a full history of the code (code, branches, tags) and the push command will then commit everything to your new target repository. These commands will NOT include meta data such as Pull Requests.

 

git clone --verbose --bare https://olduser@localhost/scm/OLDPROJECTNAME/oldreponame.git

git push --mirror https://newuser@newgitserver/scm/NEWPROJECTNAME/newreponame.git

 

CCM

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events