How to push downloaded ZIP project from bitbucket to Github?

时间:2019-04-16 23:48:03

标签: git github bitbucket

I've downloaded a project that was on BitBucket as a ZIP. I've extracted it and now I want to push that project onto a new repository in GitHub with all its content (including commit history and so on). How can I achieve this?

1 个答案:

答案 0 :(得分:3)

You can't. By downloading a project in a zip file, you are not downloading the git repository but just his content.

  1. With GitHub "Import repository"

If you want to keep the commit history, you can use the "Import repository" function of GitHub on the top right corner, just next to the profile picture.

Github Import repository

Just copy and past your bitbucket project url and GitHub will import it with all the commit history

  1. With command line

You can do the same with command line

git clone git@bitbucket.org:user/repo.git
cd repo
git remote -v
git remote rm origin # Replace origin with your remote name
git remote add origin https://github.com/user/repo.git # Create a new remote with your GitHub repository
git push -u origin master # Push all code and commit into the new remote