Since your remote was removed you don't have any origin yet so you will have to create a new repo on the server and than update your remote url to point to the new one
If you dont want the local branches simply push the ones you need.
Here is a scrip which im using to checkout all branches and than push them to the new remote
#!/bin/bash
# update the new origin
# (or leave the same one if its the same as the original)
git remote set-url origin <new-url>
# loop over all the original branches
# 1. check them out as local branches
# 2. set the origin as the track branch
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do
git branch --track ${branch#remotes/origin/} $branch
done
# now push all branches and tags
git push origin --all
git push origin --tags
What does the script do?
git branch -a
get a list of all the local branches
| grep remotes
The branch names are : 'remotes/origin/' so this will remove the remotes from the branch names
| grep -v HEAD | grep -v master
remove the master (current branch) and HEAD which is an alias to the latest commit