man*_*lds 13
建议的方法是:
git clone --bare url/for/beanstalk/repo.git .
git push --mirror git@github.com:user/repo.git
Run Code Online (Sandbox Code Playgroud)
另见:https://help.github.com/articles/importing-an-external-git-repo
# In this example, we use an external account named extuser and
# a GitHub account named ghuser to transfer repo.git
# Make a bare clone of the external repo to a local directory
$ git clone --bare https://githost.org/extuser/repo.git
# Push mirror to new GitHub repo
$ cd repo.git
$ git push --mirror https://github.com/ghuser/repo.git
# Remove temporary local repo
$ cd ..
$ rm -rf repo.git
Run Code Online (Sandbox Code Playgroud)
如果您已经在 beanstalk 上使用 Git,您可以简单地在 GitHub 上创建一个空存储库,然后将其添加为本地存储库上的远程存储库。
(假设您的存储库位于 ~/project 中)
cd ~/project
git remote add github <github-ssh-url-here>
git push github --all --tags
Run Code Online (Sandbox Code Playgroud)