1

Is there a way to only allow a GIT repository to be worked on (checked-out, push commits, etc) within a certain controlled environment, say within your VPN while you are using a repository hosting service such as Github?

I read from quora that some companies such as Facebook do this, but they probably have their own SVN/GIT server and do not rely on services such as github or gitlab.

I found this : https://stackoverflow.com/a/5507556/3138223 but the usage pattern discussed does not mention creating pull requests which is a real winner for most people as it allows extensive peer code review.

Community
  • 1
  • 1
turntwo
  • 2,452
  • 19
  • 28

1 Answers1

2

Not really. The whole point of Git is a distributed system. If I've cloned a git repository locally, I can make commits wherever I'd like. To prevent pushes from networks other than yours, you'd need to do something like configure a pre-receive hook (so you could reject the push if it doesn't come from your network), which github doesn't allow you to do, but it still wouldn't be effective since on the public internet origin IP can be faked.

There are versions of both Github and Gitlab that can be deployed internally, and by being inaccessible other than when on the network you can ensure that no pushes nor pull requests can be made when you're not on the network. (note: Commits can still be made and pushed later) I'm assuming from your phrasing though you're not wanting this as an option.

Charlie
  • 7,181
  • 1
  • 35
  • 49
  • 1
    I'll say that at my company we do use Github Enterprise and we enjoy it. But also know that there are many solutions available for within firewall Git hosting that you should do your due diligence and evaluate for organizational fit and features vs price before settling on one. Gitlab CE or EE, Atlassian Stash, Gitorious are a few others that I can think of off the top of my head. – Charlie May 12 '15 at 03:08