Question

what is Github doing when I click on these buttons? Let's say I do a pull request in Github. What is the git command I would type in (git pull ....?). And how about forking? What is Github doing behind the scenes.

Was it helpful?

Solution

A fork can be thought of as equivalent to git clone <URL for source repo> although the repo on GitHub is bare (no working tree "checked out" files) so behind the scenes they might be doing something like git clone --bare <URL>.

A pull request is asking the owner of the source repo to pull your changes in to their repo ... so there isn't an equivalent git command. It's a bit like emailing the owner of that repo to say "here are some changes I've made, hope you like them". If they accept the pull request they would, basically, then do the equivalent of git pull <URL for your repo>.

OTHER TIPS

If you are wondering how emulate the behavior of forking and pull requests, VonC has answered that far better than I can here. Basically clone and pull.

If you are interested in what GitHub is actually doing behind the scenes, its a little more complicated. Zach Holman, @holman on GitHub, recently gave a talk "How To Build A GitHub" where he goes into detail about their implementation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top