Reputation: 11
So I'm trying to move my project from one bitbucker server to a new one. On this new server the project is already created with the first commit, so at the moment I'm just trying to "refresh" it with the project from the "old server"
I've tried to do this
git clone --mirror old-repo
cd old-repo
git push --mirror new-repo
But having this error message
error: cannot spawn git: No such file or directory
Upvotes: 1
Views: 1337
Reputation: 186
After clonning repo on your local machine, you need to add new remote by:
git remote add [remote_name] [link_to_new_bitbucket_server_repo]
Then just push all needed branches to this remote by:
git push [remote_name] [branch_name]
If you already have something in new repo then you need to do all that @eftshift0 say in his answer. If you don’t know how to do this and don’t know what commands to use for this, write, I’ll try to help.
Upvotes: 0
Reputation: 30204
The ordinary way to do this is by adding a new remote to your local repo and then push whatever branches you want from your local into the new remote.... and if you have already put something on the new repo, you could rebase the whole history of whatever branches from the old repo onto the new revision that you set up on the new one... but that's an overkill... I would just push -f (enabling whatever is necessary on the new repo so that it can be done) so that I get the history there as is.
Upvotes: 1