Host projects simultaneously to GitHub and Git@osc

Source: Internet
Author: User
Tags hosting

Http://my.oschina.net/GIIoOS/blog/404555?fromerr=KHvn8UKH

GitHub is the largest git code hosting platform, [email protected] is the country's largest git code hosting platform, support free private libraries, support SVN operation, a large number of users. Many users need to host code to two platforms at the same time, the main content of this article is how to put the code on two platforms and synchronize the code.

[email protected]

[Email protected] is the country's largest git code hosting platform, support free private library, support SVN operation, many users. Many developers want to have a hosted copy of a different code hosting platform, which is not a hassle for git, and [email protected] also supports importing projects from GitHub.

Transfer code to [email protected]

This is not limited to GitHub, it can be SourceForge and bitbucket,code.taobao.org, any git-based or subversion-capable

Git repository

First we need to create an empty project on [email protected]. Use Git's –bare parameter to get a bare repository, and then push the code to [email protected] via the git push--mirror command.

git clone--bare https://github.com/forcegroup/iBurnMgr.git ibg.gitcd ibg.gitgit push--mirror https://git.oschina.net /ipvb/iburnmgr.git
Subversion repository
Git svn clone Http://myhost/repo-T trunk-b branches-t tags #将svn仓库转为git仓库 git remote add oscgit https://git.oschina.ne T/user/repo #添加remote, this needs to be built on the page git push-u oscgit--all #推送到 [email protected]
HG Warehouse

HG Warehouse does not have the official conversion support, GitHub has a hg-git:http://hg-git.github.com/can use HG to manage the Git repository, the general conversion of Hg warehouse to git warehouse is fast-export need to install HG, Recommended to use Cygwin or msys2 on Windows

mkdir Repo-git # or whatever CD repo-git git init hg-fast-export.sh-r <repo>
Add a second remote address to the local warehouse

The user may already have a warehouse locally, or hosted on GitHub or hosted on BitBucket and other code hosting platforms, if you want to put a code on [email protected], you can add a remote address to the repository so that it can be pushed to [email Protected].
First, you have to create an empty repository on [email protected], which is not initialized when you create a project. Then follow the instructions below, such as I created a HelloWorld project.

git remote-v #查看远程地址git remote add OSC https://git.oschina.net/ipvb/iBurnMgr.git# Add a new remoting address git push-u OSC--all# push all local branches GIT push osc--tags# push all tags

After each modification, you can use the Push command to submit the latest changes to [email protected].

Synchronizing on a Web page

On the git.oschina.net, if the user has landed, you can create the project, the upper right corner has a "+", click can use from GitHub import, appear as the table, click on the project you want to import, it is necessary to note that only the user participation in the project will be displayed.

Click to import the project is a long wait, after all, well-known reasons, the process will not be quick, of course, it is recommended that the user to the early migration of the code to [email protected] up.

Our developers provide users with the ability to force updates, and if the user's project is imported from GitHub, there will be a GitHub logo on the right side of the project name, and a sync button


After clicking, read the prompt carefully, because forcing synchronization overwrites the warehouse.

If you do not want to overwrite the warehouse, it is recommended that you pull the code down locally, merge and then push to [email protected].

Host projects simultaneously to GitHub and [email protected]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.