how do I sync my repository to both GitHub and my internal Git server?

We have an internal Git server and use Github.com however I am confused on how to sync my repo to both github.com and our internal git server, is this even possible?

I heard something about git remotes but i am not sure how to set that up


Add a remote using the git remote command, for example, git remote add github git@github.com:user/repo.git .

If you want to push separately, you're set. If you'd like to have git push push to multiple remotes, you can setup your .git/config as shown in this answer. In short, you rename your current origin remote, and create a new origin which contains multiple url entries and no fetch entry, then configure your branches to pull from whichever source you consider authoritative.

You can use a non-origin remote for the combined push if you'd like to have that functionality, but don't want it to be the default behavior.


First clone repository into you system via github.It will provide automatically after you login with github.Then start cloning.Then you can start work from your cloning location's project. Just push and pull your changes.

You can learn more about github from here Branching and Merging

链接地址: http://www.djcxy.com/p/49782.html

上一篇: 推送到远程服务器和Github

下一篇: 我如何将存储库同步到GitHub和我的内部Git服务器?