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?
答案 0 :(得分:3)
You can't. By downloading a project in a zip file, you are not downloading the git repository but just his content.
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.
Just copy and past your bitbucket project url and GitHub will import it with all the commit history
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