6 个托管 git 仓库的地方
Git GitHub

> 
> GitHub 被收购导致一些用户去寻找这个流行的代码仓库的替代品。这里有一些你可以考虑一下。
> 
> 
> 


![](/data/attachment/album/201810/25/143554rszbl3h7iahqcm73.jpg)


也许你是少数一些没有注意到的人之一，就在之前，[微软收购了 GitHub](https://www.theverge.com/2018/6/4/17422788/microsoft-github-acquisition-official-deal)。两家公司达成了共识。微软在近些年已经变成了开源的有力支持者，而 GitHub 从成立起，就已经成为了大量的开源项目的实际代码库。


然而，最近发生的这次收购可能会带给你一些苦恼。毕竟公司的收购让你意识到了你的开源代码放在了一个商业平台上。可能你现在还没准备好迁移到其他的平台上去，但是至少这可以给你提供一些可选项。让我们找找网上现在都有哪些可用的平台。


### 选择之一： GitHub


严格来说，这是一个合格的选项。[GitHub](https://github.com/) 历史上没有什么失信的地方，而且微软后来也一直笑对开源。把你的项目继续放在 GitHub 上，保持观望没有什么不可以。它现在依然是最大的软件开发的网络社区，同时还有许多对于问题追踪、代码审查、持续集成、通用的代码管理等很有用的工具。而且它还是基于 Git 的，这是每个人都喜欢的开源版本控制系统。你的代码还是你的代码。如果没有出现什么问题，那保持原状是没错的。


### 选择之二： GitLab


[GitLab](https://gitlab.com) 是考虑替代代码库平台时的主要竞争者。它是完全开源的。你可以像在 GitHub 一样把你的代码托管在 GitLab，但你也可以选择在你自己的服务器上自行托管自己的 GitLab 实例，并完全控制谁可以访问那里的所有内容以及如何访问和管理。GitLab 与 GitHub 功能几乎相同，有些人甚至可能会说它的持续集成和测试工具更优越。尽管 GitLab 上的开发者社区肯定比 GitHub 上的开发者社区要小，但这并没有什么。你可能会在那里的人群中找到更多志同道合的开发者。


### 选择之三： Bitbucket


[Bitbucket](https://bitbucket.org) 已经存在很多年了。在某些方面，它可以作为 GitHub 未来的一面镜子。Bitbucket 八年前被一家大公司（Atlassian）收购，并且已经经历了一些变化。它仍然是一个像 GitHub 这样的商业平台，但它远不是一个创业公司，而且从组织上说它的基础相当稳定。Bitbucket 具有 GitHub 和 GitLab 上的大部分功能，以及它自己的一些新功能，如对 [Mercurial](https://www.mercurial-scm.org/wiki/Repository) 仓库的原生支持。


### 选择之四： SourceForge


[SourceForge](https://sourceforge.net) 是开源代码库的鼻祖。如果你曾经有一个开源项目，Sourceforge 就是那个托管你的代码并向其他人分享你的发布版本的地方。它迁移到 Git 版本控制用了一段时间，它有一些商业收购和再次收购的历史，以及一些对某些开源项目糟糕的捆绑决策。也就是说，SourceForge 从那时起似乎已经恢复，该网站仍然是一个有着不少开源项目的地方。然而，很多人仍然感到有点受伤，而且有些人并不是很支持它的平台货币化的各种尝试，所以一定要睁大眼睛。


### 选择之五： 自己管理


如果你想自己掌握自己项目的命运（除了你自己没人可以指责你），那么一切都由自己来做可能对你来说是最佳的选择。无论对于大项目还是小项目，都是好的选择。Git 是开源的，所以自己托管也很容易。如果你想要问题追踪和代码审查功能，你可以运行一个 GitLab 或者 [Phabricator](https://phacility.com/phabricator/) 的实例。对于持续集成，你可以设置自己的 [Jenkins](https://jenkins.io) 自动化服务实例。是的，你需要对自己的基础架构开销和相关的安全要求负责。但是，这个设置过程并不是很困难。所以如果你不想自己的代码被其他人的平台所吞没，这就是一种很好的方法。


### 选择之六：以上全部


以下是所有这些的美妙之处：尽管这些平台上有一些专有的选项，但它们仍然建立在坚实的开源技术之上。而且不仅仅是开源，而是明确设计为分布在大型网络（如互联网）上的多个节点上。你不需要只使用一个。你可以使用一对……或者全部。使用 GitLab 将你自己的设施作为保证的基础，并在 GitHub 和 Bitbucket 上安装克隆存储库，以进行问题跟踪和持续集成。将你的主代码库保留在 GitHub 上，但是出于你自己的考虑，可以在 GitLab 上安装“备份”克隆。


关键在于你可以选择。我们能有这么多选择，都是得益于那些非常有用而强大的项目之上的开源许可证。未来一片光明。


当然，在这个列表中我肯定忽略了一些开源平台。方便的话请补充给我们。你是否使用了多个平台？哪个是你最喜欢的？你都可以在这里说出来！




---


via: <https://opensource.com/article/18/8/github-alternatives>


作者：[Jason van Gumster](https://opensource.com/users/mairin) 选题：[lujun9972](https://github.com/lujun9972) 译者：[dianbanjiu](https://github.com/dianbanjiu) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
Perhaps you're one of the few people who didn't notice, but a few months back, [Microsoft bought GitHub](https://www.theverge.com/2018/6/4/17422788/microsoft-github-acquisition-official-deal). Nothing against either company. Microsoft has become a vocal supporter of open source in recent years, and GitHub has been the de facto code repository for a heaping large number of open source projects almost since its inception.

However, the recent(-ish) purchase may have gotten you a little itchy. After all, there's nothing quite like a corporate buy-out to make you realize you've had your open source code sitting on a commercial platform. Maybe you're not quite ready to jump ship just yet, but it would at least be helpful to know your options. Let's have a look around the web and see what's available.

## Option 1: GitHub

Seriously, this is a valid option. [GitHub](https://github.com/) doesn't have a history of acting in bad faith, and Microsoft certainly has been smiling on open source of late. There's nothing wrong with keeping your project on GitHub and taking a wait-and-see perspective. It's still the largest community website for software development, and it still has some of the best tools for issue tracking, code review, continuous integration, and general code management. And its underpinnings are still on Git, everyone's favorite open source distributed version control system. Your code is still your code. There's nothing wrong with leaving things where they are if nothing is broken.

## Option 2: GitLab

[GitLab](https://gitlab.com) is probably the leading contender when it comes to alternative code platforms. It's fully open source. You can host your code right on GitLab's site much like you would on GitHub, but you can also choose to self-host a GitLab instance of your own on your own server and have full control over who has access to everything there and how things are managed. GitLab pretty much has feature parity with GitHub, and some folks might even say its continuous integration and testing tools are superior. Although the community of developers on GitLab is certainly smaller than the one on GitHub, it's still nothing to sneeze at. And it's possible that you'll find more like-minded developers among the population there.

## Option 3: Bitbucket

[Bitbucket](https://bitbucket.org) has been around for many years. In some ways, it could serve as a looking glass into the future of GitHub. Bitbucket was acquired by a larger corporation (Atlassian) eight years ago and has already been through some of that change-over process. It's still a commercial platform like GitHub, but it's far from being a startup, and it's on pretty stable footing, organizationally speaking. Bitbucket shares most of the features available on GitHub and GitLab, plus a few novel features of its own, like native support for [Mercurial](https://www.mercurial-scm.org/wiki/Repository) repositories.

## Option 4: SourceForge

The granddaddy of open source code repository sites is [SourceForge](https://sourceforge.net). It used to be that if you had an open source project, SourceForge was *the* place to host your code and share your releases. It took a little while to migrate to Git for version control, and it had its own rash of commercial acquiring and re-acquiring events, coupled with a few unfortunate bundling decisions for a few open source projects. That said, SourceForge seems to have recovered since then, and the site is still a place where quite a few open source projects live. A lot of folks still feel a bit burned, though, and some people aren't huge fans of its various attempts to monetize the platform, so be sure you go in with open eyes.

## Option 5: Roll your own

If you want full control of your project's destiny (and no one to blame but yourself), then doing it all yourself may be the best option for you. It is a good alternative for both large and small projects. Git is open source, so it's easily self-hosted. If you want issue tracking and code review, you can run an instance of GitLab or [Phabricator](https://phacility.com/phabricator/). For continuous integration, you can set up your own instance of the [Jenkins](https://jenkins.io) automation server. Yes, you'll need to take responsibility for your own infrastructure overhead and the associated security requirements. However, it's not that hard to get yourself set up. And if you want a sure-fire way to avoid being beholden to the whims of anyone else's platform, this is the way to do it.

## Option 6: All of the above

Here's the beauty of all of this: Despite the proprietary drapery strewn over some of these platforms, they're still built on top of solid open source technology. And not just open source, but explicitly designed to be distributed across multiple nodes on a large network (like the internet). You're not required to use just one. You can use a couple… or all of them. Roll your own setup as a guaranteed home base using GitLab and have clone repositories on GitHub and Bitbucket for issue tracking and continuous integration. Keep your main codebase on GitHub but have "backup" clones sitting on GitLab for your own piece of mind.

The key thing is you have options. And we have those options thanks to open source licensing on very useful and powerful projects. The future is bright.

Of course, I'm bound to have missed some of the open source options available out there. Feel free to pipe up with your favorites. Are you using multiple platforms? What's your setup? Let everyone know in the comments!

## 18 Comments