Exact git command line equivalents to the "Pull Request" and "Fork Repo" buttons in Github

StackOverflow https://stackoverflow.com/questions/14986482

Вопрос

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.

Это было полезно?

Решение

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>.

Другие советы

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top