The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
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

TAGS
AUG Leaders

Atlassian Community Events