Move BitBucket repository to cPanel

31 Views Asked by At

I have a repository that is currently hosted on BitBucket, that I want to move to Git cPanel version control (run by my hosting company), so I can then delete my account on BitBucket and host all my repositories in a single location. I do not want to have any links/ties to the original BitBucket repository, but I do need to retain all of the repository history.

I did try... git push -u origin master ...but this made me nervous... branch 'master' set up to track 'origin/master'.

Is this possible, and if so, how?

2

There are 2 best solutions below

1
Juan_m_2 On BEST ANSWER

You must first change your origin remote url with the new cPanel one

git remote set-url origin <new-cpanel-gitrepo-url>

And then push like you were doing before

0
Mohammed Ehab On

first, to retain the only certain number of commits, you can use either

git merge --interactive or --squash, all data about it can be found here.

second, to push to Cpanel you add it either by adding new remote to your remote

git remote add <your-remote-name> <url of your cpanel>

or changing the url of the origin remote you added by

git remote set-url origin <url of cpanel>