Reputation: 51
I currently have my project hosted on VSTS (Visual Studio Team Services) and I would also like to host it on GitHub. I like VSTS because I used it at my internship and got very used to it but I also like the familiar feel of GitHub and I know that my friends who are also going to be working on this project with me will prefer GitHub.
Is it possible to host the code in both places and have each of them update accordingly not matter where you push your code?
For example if someone else clones the repo from GitHub, make changes, and pushes them to GitHub can I make it so VSTS automatically picks up those changes, or vise-versa?
Upvotes: 3
Views: 114
Reputation: 25820
The Short and Sweet Answer
Technically possible. But it's a bit like carrying two watches on your wrist... you'll have trouble keeping them synchronized, and you'll never be sure which one is "true". I suspect that after trying it for a month or two, you and/or your team will naturally abandon one and use the other exclusively.
The Long-Winded Answer
Git is inherently and intentionally de-centralized. Servers are no more or less important than individual computers. The repo on your machine carries the same history and the same core features as the repos on VSTS and GitHub.
The problem, of course, is that total anarchy leads to confusion and inefficiency. Humans, by and large, strongly prefer hierarchy and leadership. So, even though the technology is de-centralized, we are not, and we tend to get together and choose one particular repo as our source of truth. If it's not in that repo, then it's not "official". (Even when there are multiple repos, individuals tend to be loyal to one and only one, to the exclusion of all others.)
As an example, in the early days of git, before there were hosted solutions, Linus Torvalds' personal Linux repo was the source of truth. Sure, you could have your own, but everyone more or less recognized that his version was the most complete and most up-to-date and the most likely to stay that way, so everyone sent him their pull requests and based their new work off his master branch.
The same is going to be true for your project. You can set up as many hosted solutions as you want, but you will quickly find that, for each developer, only two repos will be significant... their personal repo, and the repo that they push and pull to and from (their "remote"). You'll find this is true for you as well. The effort required to keep VSTS updated will quickly feel redundant and unnecessary... you already have an up-to-date repo on GitHub, and your personal repo is where you do all of your work anyway, so why are you even trying to keep a second remote up-to-date?
You can try it for a while if you want to, and I'm sure you could use some clever hooks to keep VSTS mostly up-to-date, but over time the effort and expense (in time, if not money) will probably lead you to abandon it and just work with GitHub. If you really, strongly prefer VSTS, then you should set that up instead of GitHub. You can always migrate later... it's relatively easy to do with git... but you will probably find that having one remote active at a time is going to be better for everyone involved.
Upvotes: 1