I love using Github and have been interested in learning more about how git works behind the scenes. Are there any cool features of git that I haven't been exposed to through github.com?
-
Nobody except you knows what you have or haven't been exposed to. Read a git book. There are several ones, freely available online. – JB Nizet Apr 09 '14 at 06:21
-
The same question [was asked and answered here](http://stackoverflow.com/a/11820206/3428658) – Paul Bele Apr 09 '14 at 06:26
1 Answers
In principle, all Github does is host your Git repository. Anything you do in your repository to add to/mangle its history is totally orthogonal to what features Github offers. Any differences/restrictions are in the hosting side of things, so the real question is: what's the difference to hosting your repositories yourself on your own server?
When using Git on your own server, it allows you to provide your own code to inspect and possibly reject pushes, using a hooks mechanism. This means that you can write a hook script that makes sure only certain people can push changes to certain subdirectories of your repository, for example. A whole lot of other things can be done with this, of course – you're only limited by your imagination. And maybe reality. ;)
Github doesn't want to run arbitrary code you provide for your repositories, of course, so you can't do quite as fancy custom things if your repository is hosted there. They do allow you to send notifications to other servers via HTTP, though, so while you can't make your own rules for restricting pushes, at least you can let other services know about them.
To get an idea of what else can be done with self-hosted repositories, check out Gitolite (heads up: setting it up requires a certain level of experience with server administration). It has a few extra tricks to restrict fetches, too, even though Git doesn't provide a hook for that.

- 17,870
- 3
- 59
- 51