Are git forks actually git clones?
I keep hearing people say they're forking code in git. Git "fork" sounds suspiciously like git "clone" plus some (meaningless) psychological willingness to forgo future merges. There is no fork command in git, right?
Github makes forks a little more real by stapling correspondence onto it. That is, you press the fork button and later, when you press the pull request button, the system is smart enough to email the owner. Hence, it's a little bit of a dance around repo ownership and permissions.
Yes/No? Any angst over Github extending git in this direction? Or any rumors of git absorbing the functionality?
git github git-clone git-fork
add a comment |
I keep hearing people say they're forking code in git. Git "fork" sounds suspiciously like git "clone" plus some (meaningless) psychological willingness to forgo future merges. There is no fork command in git, right?
Github makes forks a little more real by stapling correspondence onto it. That is, you press the fork button and later, when you press the pull request button, the system is smart enough to email the owner. Hence, it's a little bit of a dance around repo ownership and permissions.
Yes/No? Any angst over Github extending git in this direction? Or any rumors of git absorbing the functionality?
git github git-clone git-fork
8
Yeah, it is just a type of clone which is tracked by the github database.
– Paŭlo Ebermann
Jun 9 '11 at 1:21
14
Doesn't GitHub do something special to avoid doubling the storage requirements (on GitHub's own servers)?
– Keith Thompson
May 10 '12 at 3:44
14
Not mentioned yet: Deleting a private repo deletes all its forks. Deleting a public repo keeps the forks but promotes one fork to be the new parent repo. If your boss makes your public repo private, it breaks all the existing forks and you won't be able to make pull requests from them to the private repo. help.github.com/articles/…
– Plato
Feb 25 '16 at 0:21
add a comment |
I keep hearing people say they're forking code in git. Git "fork" sounds suspiciously like git "clone" plus some (meaningless) psychological willingness to forgo future merges. There is no fork command in git, right?
Github makes forks a little more real by stapling correspondence onto it. That is, you press the fork button and later, when you press the pull request button, the system is smart enough to email the owner. Hence, it's a little bit of a dance around repo ownership and permissions.
Yes/No? Any angst over Github extending git in this direction? Or any rumors of git absorbing the functionality?
git github git-clone git-fork
I keep hearing people say they're forking code in git. Git "fork" sounds suspiciously like git "clone" plus some (meaningless) psychological willingness to forgo future merges. There is no fork command in git, right?
Github makes forks a little more real by stapling correspondence onto it. That is, you press the fork button and later, when you press the pull request button, the system is smart enough to email the owner. Hence, it's a little bit of a dance around repo ownership and permissions.
Yes/No? Any angst over Github extending git in this direction? Or any rumors of git absorbing the functionality?
git github git-clone git-fork
git github git-clone git-fork
edited Nov 26 '15 at 23:23
Madara Uchiha♦
115k42206259
115k42206259
asked Jun 8 '11 at 23:45
Brian
3,8653108
3,8653108
8
Yeah, it is just a type of clone which is tracked by the github database.
– Paŭlo Ebermann
Jun 9 '11 at 1:21
14
Doesn't GitHub do something special to avoid doubling the storage requirements (on GitHub's own servers)?
– Keith Thompson
May 10 '12 at 3:44
14
Not mentioned yet: Deleting a private repo deletes all its forks. Deleting a public repo keeps the forks but promotes one fork to be the new parent repo. If your boss makes your public repo private, it breaks all the existing forks and you won't be able to make pull requests from them to the private repo. help.github.com/articles/…
– Plato
Feb 25 '16 at 0:21
add a comment |
8
Yeah, it is just a type of clone which is tracked by the github database.
– Paŭlo Ebermann
Jun 9 '11 at 1:21
14
Doesn't GitHub do something special to avoid doubling the storage requirements (on GitHub's own servers)?
– Keith Thompson
May 10 '12 at 3:44
14
Not mentioned yet: Deleting a private repo deletes all its forks. Deleting a public repo keeps the forks but promotes one fork to be the new parent repo. If your boss makes your public repo private, it breaks all the existing forks and you won't be able to make pull requests from them to the private repo. help.github.com/articles/…
– Plato
Feb 25 '16 at 0:21
8
8
Yeah, it is just a type of clone which is tracked by the github database.
– Paŭlo Ebermann
Jun 9 '11 at 1:21
Yeah, it is just a type of clone which is tracked by the github database.
– Paŭlo Ebermann
Jun 9 '11 at 1:21
14
14
Doesn't GitHub do something special to avoid doubling the storage requirements (on GitHub's own servers)?
– Keith Thompson
May 10 '12 at 3:44
Doesn't GitHub do something special to avoid doubling the storage requirements (on GitHub's own servers)?
– Keith Thompson
May 10 '12 at 3:44
14
14
Not mentioned yet: Deleting a private repo deletes all its forks. Deleting a public repo keeps the forks but promotes one fork to be the new parent repo. If your boss makes your public repo private, it breaks all the existing forks and you won't be able to make pull requests from them to the private repo. help.github.com/articles/…
– Plato
Feb 25 '16 at 0:21
Not mentioned yet: Deleting a private repo deletes all its forks. Deleting a public repo keeps the forks but promotes one fork to be the new parent repo. If your boss makes your public repo private, it breaks all the existing forks and you won't be able to make pull requests from them to the private repo. help.github.com/articles/…
– Plato
Feb 25 '16 at 0:21
add a comment |
10 Answers
10
active
oldest
votes
Fork, in the GitHub context, doesn't extend Git.
It only allows clone on the server side.
When you clone a GitHub repo on your local workstation, you cannot contribute back to the upstream repo unless you are explicitly declared as "contributor". That's because your clone is a separate instance of that project. If you want to contribute to the project, you can use forking to do it, in the following way:
- clone that GitHub repo on your GitHub account (that is the "fork" part, a clone on the server side)
- contribute commits to that GitHub repo (it is in your own GitHub account, so you have every right to push to it)
- signal any interesting contribution back to the original GitHub repo (that is the "pull request" part by way of the changes you made on your own GitHub repo)
Check also "Collaborative GitHub Workflow".
If you want to keep a link with the original repo (also called upstream), you need to add a remote referring that original repo.
See "What is the difference between origin and upstream in github"
And with Git 2.20 (Q4 2018) and more, fetching from fork is more efficient, with delta islands.
6
"When you are cloning a GitHub repo on your local workstation, you cannot contribute back to the upstream repo unless you are explicitly declared as "contributor"." --- Is this not true with "forking"? Please explain.
– chharvey
Aug 3 '13 at 18:16
58
@TestSubject528491 no, with a fork, that means you are cloning the upstream repo as your own repo on the GitHub server side. Then you can locally clone that new "fork" repo on your computer and freely push back on it, since you are the creator and owner of that fork.
– VonC
Aug 3 '13 at 19:00
8
To me, the key point is that you can't submit a PR from your local copy unless you're declared to be a contributor. I'm so used to submitting PRs from my local repo, but that's because I'm always marked as a contributor. If you think about it, to submit a PR you have to push a branch to the remote repo and then create the PR. I guess it makes sense if you don't want random people creating branches on your repo. And that you'd prefer them to fork it and submit PRs that way instead.
– Adam Zerner
Feb 22 '16 at 1:18
I've seen the second "upstream" remote approach elsewhere, but isn't it more straightforward to pull directly from "GitHub - Original" to "GitHub - Fork"? The second remote approach didn't seem to work in my Eclipse and eGit setup, failing to push to my "GitHub - Fork" repo (nothing to push).
– William T. Mallard
Sep 28 '16 at 22:05
Never mind, the info here link gave me some insight. As a contributor it makes sense to pull from "GitHub - Original" to "GitHub - Fork", then from " - Fork" to local machine, but if you're the owner you probably want to pull directly from my " - Fork" first to review, run tests, etc. before pushing to " - Original".
– William T. Mallard
Sep 28 '16 at 22:29
|
show 6 more comments
I keep hearing people say they're forking code in git. Git "fork" sounds suspiciously like git "clone" plus some (meaningless) psychological willingness to forgo future merges. There is no fork command in git, right?
"Forking" is a concept, not a command specifically supported by any version control system.
The simplest kind of forking is synonymous with branching. Every time you create a branch, regardless of your VCS, you've "forked". These forks are usually pretty easy to merge back together.
The kind of fork you're talking about, where a separate party takes a complete copy of the code and walks away, necessarily happens outside the VCS in a centralized system like Subversion. A distributed VCS like Git has much better support for forking the entire codebase and effectively starting a new project.
Git (not GitHub) natively supports "forking" an entire repo (ie, cloning it) in a couple of ways:
- when you clone, a remote called
origin
is created for you - by default all the branches in the clone will track their
origin
equivalents - fetching and merging changes from the original project you forked from is trivially easy
Git makes contributing changes back to the source of the fork as simple as asking someone from the original project to pull from you, or requesting write access to push changes back yourself. This is the part that GitHub makes easier, and standardizes.
Any angst over Github extending git in this direction? Or any rumors of git absorbing the functionality?
There is no angst because your assumption is wrong. GitHub "extends" the forking functionality of Git with a nice GUI and a standardized way of issuing pull requests, but it doesn't add the functionality to Git. The concept of full-repo-forking is baked right into distributed version control at a fundamental level. You could abandon GitHub at any point and still continue to push/pull projects you've "forked".
5
Thanks for your excellent answer. I just want to clarify, this means, outside the context of github I could clone someX project
on my machine. If I make changes in my local and don't have write access to origin, I will email the author of the project to request a pull. He will make a remote called gideon which will be a url to my local clone, and he can pull, right?
– gideon
Sep 16 '13 at 7:51
1
If you want to contribute your changes to a project you can either save them into files e.g. using git format-patch and attach them to an email to someone who has that write access, or you can obtain your own hosting, push your work to that and send the URL in an email e.g. using the git request-pull command. Repos on workstations are not usually direclty accessible online.
– bdsl
Jan 25 '16 at 11:11
But yes, if your workstation happens to be accessible over the internet to the author of the project then you can simply send the URL to them and they can add it as a remote and pull from it.
– bdsl
Jan 25 '16 at 11:12
1
Re: angst, the only such for me is that there's no link or button to click to create a pull-from-my-repo's-perspective button where GitHub tells you you're 50 commits behind. No biggie now that I know they're using the term "Pull Request" to also include requests for pulling from the upstream to your GitHub fork. Git is hard.
– William T. Mallard
Sep 28 '16 at 22:10
add a comment |
Yes Fork is a clone. It emerged because, you cannot push to others' copies without their permission. What they do is make a copy of it for you (fork), where you will have write permission as well.
In the future if the actual owner or others users with a fork like your changes they can pull it back to their own repo. Alternatively you can send them a "pull-request".
Can I simply clone the repository to my local machine, create a branch, then submit a pull request to the original owner? It seems redundant to have multiple copies of repos hosted all over GitHub, just to facilitate code updates.
– Casey
Sep 1 '15 at 12:57
4
@Casey You can only send a pull request through GitHub from GitHub itself and you can only send a GitHub pull request from a branch that exists on GitHub. If you are not a collaborator on the Repository in question, there is no way for you to create a branch from which you can initiate a GitHub pull request. Nothing stops you from doing it via email the old fashioned way, but GitHub plays no part in that.
– Beau Simensen
Sep 6 '15 at 20:24
2
@Casey, a reason is that normally others do not have URL access to your workstation. The GitHubfork
means there is a copy of your work on the GitHub server, that you canpush
to and which others do have URL access to so they canpull
. Thepull request
is just a standard way to getting the URL for your copy (up on GitHub) to them so they can easily pull it into the their repository.
– Jesse Chisholm
Jun 13 '16 at 23:19
This should be the correct/accepted answer I believe. Imagine a mess in a scene where a team of 15-20 developers creating branches and pushing to origin versus 15-20 developers having their own copy of same repository and making as many branches and doing changes and pushing it back. Then Author of original repository can pull only changes he/she wants.
– Kishor Pawar
Jul 19 '16 at 7:31
add a comment |
"Fork" in this context means "Make a copy of their code so that I can add my own modifications". There's not much else to say. Every clone is essentially a fork, and it's up to the original to decide whether to pull the changes from the fork.
2
In specific: "Make a copy of their codeon the GitHub server
so that I can add my own modificationsand others can have URL access to my version
". Most local workstations do not offer URL access for anyone to be able to pull. But if you push to your fork on the server, then they can have the URL for the pull.
– Jesse Chisholm
Jun 13 '16 at 23:21
The question is not about forking is in general, but about the GitHub forking specifically.
– reinierpost
Jun 8 '17 at 8:46
add a comment |
Cloning involves making a copy of the git repository to a local machine, while forking is cloning the repository into another repository. Cloning is for personal use only (although future merges may occur), but with forking you are copying and opening a new possible project path
add a comment |
I think fork is a copy of other repository but with your account modification. for example, if you directly clone other repository locally, the remote object origin is still using the account who you clone from. You can't commit and contribute your code. It is just a pure copy of codes. Otherwise, If you fork a repository, it will clone the repo with the update of your account setting in you github account. And then cloning the repo in the context of your account, you can commit your codes.
add a comment |
Forking is done when you decide to contribute to some project. You would make a copy of the entire project along with its history logs. This copy is made entirely in your repository and once you make these changes, you issue a pull request. Now its up-to the owner of the source to accept your pull request and incorporate the changes into the original code.
Git clone is an actual command that allows users to get a copy of the source.
git clone [URL]
This should create a copy of [URL] in your own local repository.
add a comment |
Apart from the fact that cloning is from server to your machine and forking is making a copy on the server itself, an important difference is that when we clone, we actually get all the branches, labels, etc. But when we fork, we actually only get the current files in the master branch, nothing other than that. This means we don't get the other branches, etc.
Hence if you have to merge something back to the original repo, it is a inter-repo merge and will definitely need higher privileges.
Fork is not a command in git, it is just a concept which Github implements. Remember Git was designed to work in peer to peer environment without the need to synchronize stuff with any master copy. The server is just another peer but we look at it as a master copy.
5
Huh? A fork gets all the branches, though you have to know where to look (hint:git branch -a
).
– tripleee
Jan 12 '16 at 5:52
add a comment |
There is a misunderstanding here with respect to what a "fork" is. A fork is in fact nothing more than a set of per-user branches. When you push to a fork you actually do push to the original repo because that is the ONLY repo.
You can try this out by pushing to a fork, noting the commit and then going to the original repo and using the commit ID, you'll see that the commit is "in" the original repo.
This makes a lot of sense but is far from obvious (I only discovered this accidentally recently).
When John forks repo SuperProject what seems to actually happen is that all branches in the source repo are replicated with a name like "John.master" and "John.new_gui_project" etc.
Github "hides" the "John." from us and gives us the illusion we have our own "copy" of the repo in Github, but we don't and nor is one even needed.
So my fork's branch "master" is actually named "Korporal.master" but the Github UI never reveals this, showing me only "master".
This is pretty much what I think goes on under the hood anyway based on stuff I've been doing recently and when you ponder it, is very good design.
For this reason I think it would be very easy for Microsoft to implement Git forks in their Visual Studio Team services offering.
Dear Hugh, half of your response is actually incorrect -- a fork is a clone of a whole repository from one user account to another user account, together with all the branches and history. When you commit to the fork, nothing changes in the original repository from which you forked. But besides these few misunderstandings on your part regarding what a "fork" is, there is now some good news: Visual Studio Team services include now a "Fork" functionality. ;)
– Sorin Postelnicu
Jan 11 at 23:01
1
@SorinPostelnicu source? I'm inclined to believe Hugh here due to personal experience of forks behaving in ways that are inconstant with them being a simple clone of the repository. For example, when upstream is deleted, forks are deleted (as was mentioned in a comment on OP's question) and sometimes upstream has wound up merging things into branches of my forks when accepting a pull request, without me doing anything.
– potato
Feb 15 at 3:12
Indeed this appears to be the case. After all it would be incredibly stupid for GitHub to literallygit clone
a whole new repository (even a "bare" one) every time someone pushes the "fork" button -- that would be an incredible waste of storage, and likely an attack vector as well.
– Greg A. Woods
Mar 23 at 23:37
add a comment |
In simplest terms,
When you say you are Forking a repository, you are basically creating a copy of the original repository under your GitHub ID in your Github account.
and
When you say you are Cloning a repository, you are creating a local copy of the original repository in your system(pc/lappy) directly without having a copy in your Github account.
add a comment |
protected by Tushar Gupta Nov 25 '14 at 7:21
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
10 Answers
10
active
oldest
votes
10 Answers
10
active
oldest
votes
active
oldest
votes
active
oldest
votes
Fork, in the GitHub context, doesn't extend Git.
It only allows clone on the server side.
When you clone a GitHub repo on your local workstation, you cannot contribute back to the upstream repo unless you are explicitly declared as "contributor". That's because your clone is a separate instance of that project. If you want to contribute to the project, you can use forking to do it, in the following way:
- clone that GitHub repo on your GitHub account (that is the "fork" part, a clone on the server side)
- contribute commits to that GitHub repo (it is in your own GitHub account, so you have every right to push to it)
- signal any interesting contribution back to the original GitHub repo (that is the "pull request" part by way of the changes you made on your own GitHub repo)
Check also "Collaborative GitHub Workflow".
If you want to keep a link with the original repo (also called upstream), you need to add a remote referring that original repo.
See "What is the difference between origin and upstream in github"
And with Git 2.20 (Q4 2018) and more, fetching from fork is more efficient, with delta islands.
6
"When you are cloning a GitHub repo on your local workstation, you cannot contribute back to the upstream repo unless you are explicitly declared as "contributor"." --- Is this not true with "forking"? Please explain.
– chharvey
Aug 3 '13 at 18:16
58
@TestSubject528491 no, with a fork, that means you are cloning the upstream repo as your own repo on the GitHub server side. Then you can locally clone that new "fork" repo on your computer and freely push back on it, since you are the creator and owner of that fork.
– VonC
Aug 3 '13 at 19:00
8
To me, the key point is that you can't submit a PR from your local copy unless you're declared to be a contributor. I'm so used to submitting PRs from my local repo, but that's because I'm always marked as a contributor. If you think about it, to submit a PR you have to push a branch to the remote repo and then create the PR. I guess it makes sense if you don't want random people creating branches on your repo. And that you'd prefer them to fork it and submit PRs that way instead.
– Adam Zerner
Feb 22 '16 at 1:18
I've seen the second "upstream" remote approach elsewhere, but isn't it more straightforward to pull directly from "GitHub - Original" to "GitHub - Fork"? The second remote approach didn't seem to work in my Eclipse and eGit setup, failing to push to my "GitHub - Fork" repo (nothing to push).
– William T. Mallard
Sep 28 '16 at 22:05
Never mind, the info here link gave me some insight. As a contributor it makes sense to pull from "GitHub - Original" to "GitHub - Fork", then from " - Fork" to local machine, but if you're the owner you probably want to pull directly from my " - Fork" first to review, run tests, etc. before pushing to " - Original".
– William T. Mallard
Sep 28 '16 at 22:29
|
show 6 more comments
Fork, in the GitHub context, doesn't extend Git.
It only allows clone on the server side.
When you clone a GitHub repo on your local workstation, you cannot contribute back to the upstream repo unless you are explicitly declared as "contributor". That's because your clone is a separate instance of that project. If you want to contribute to the project, you can use forking to do it, in the following way:
- clone that GitHub repo on your GitHub account (that is the "fork" part, a clone on the server side)
- contribute commits to that GitHub repo (it is in your own GitHub account, so you have every right to push to it)
- signal any interesting contribution back to the original GitHub repo (that is the "pull request" part by way of the changes you made on your own GitHub repo)
Check also "Collaborative GitHub Workflow".
If you want to keep a link with the original repo (also called upstream), you need to add a remote referring that original repo.
See "What is the difference between origin and upstream in github"
And with Git 2.20 (Q4 2018) and more, fetching from fork is more efficient, with delta islands.
6
"When you are cloning a GitHub repo on your local workstation, you cannot contribute back to the upstream repo unless you are explicitly declared as "contributor"." --- Is this not true with "forking"? Please explain.
– chharvey
Aug 3 '13 at 18:16
58
@TestSubject528491 no, with a fork, that means you are cloning the upstream repo as your own repo on the GitHub server side. Then you can locally clone that new "fork" repo on your computer and freely push back on it, since you are the creator and owner of that fork.
– VonC
Aug 3 '13 at 19:00
8
To me, the key point is that you can't submit a PR from your local copy unless you're declared to be a contributor. I'm so used to submitting PRs from my local repo, but that's because I'm always marked as a contributor. If you think about it, to submit a PR you have to push a branch to the remote repo and then create the PR. I guess it makes sense if you don't want random people creating branches on your repo. And that you'd prefer them to fork it and submit PRs that way instead.
– Adam Zerner
Feb 22 '16 at 1:18
I've seen the second "upstream" remote approach elsewhere, but isn't it more straightforward to pull directly from "GitHub - Original" to "GitHub - Fork"? The second remote approach didn't seem to work in my Eclipse and eGit setup, failing to push to my "GitHub - Fork" repo (nothing to push).
– William T. Mallard
Sep 28 '16 at 22:05
Never mind, the info here link gave me some insight. As a contributor it makes sense to pull from "GitHub - Original" to "GitHub - Fork", then from " - Fork" to local machine, but if you're the owner you probably want to pull directly from my " - Fork" first to review, run tests, etc. before pushing to " - Original".
– William T. Mallard
Sep 28 '16 at 22:29
|
show 6 more comments
Fork, in the GitHub context, doesn't extend Git.
It only allows clone on the server side.
When you clone a GitHub repo on your local workstation, you cannot contribute back to the upstream repo unless you are explicitly declared as "contributor". That's because your clone is a separate instance of that project. If you want to contribute to the project, you can use forking to do it, in the following way:
- clone that GitHub repo on your GitHub account (that is the "fork" part, a clone on the server side)
- contribute commits to that GitHub repo (it is in your own GitHub account, so you have every right to push to it)
- signal any interesting contribution back to the original GitHub repo (that is the "pull request" part by way of the changes you made on your own GitHub repo)
Check also "Collaborative GitHub Workflow".
If you want to keep a link with the original repo (also called upstream), you need to add a remote referring that original repo.
See "What is the difference between origin and upstream in github"
And with Git 2.20 (Q4 2018) and more, fetching from fork is more efficient, with delta islands.
Fork, in the GitHub context, doesn't extend Git.
It only allows clone on the server side.
When you clone a GitHub repo on your local workstation, you cannot contribute back to the upstream repo unless you are explicitly declared as "contributor". That's because your clone is a separate instance of that project. If you want to contribute to the project, you can use forking to do it, in the following way:
- clone that GitHub repo on your GitHub account (that is the "fork" part, a clone on the server side)
- contribute commits to that GitHub repo (it is in your own GitHub account, so you have every right to push to it)
- signal any interesting contribution back to the original GitHub repo (that is the "pull request" part by way of the changes you made on your own GitHub repo)
Check also "Collaborative GitHub Workflow".
If you want to keep a link with the original repo (also called upstream), you need to add a remote referring that original repo.
See "What is the difference between origin and upstream in github"
And with Git 2.20 (Q4 2018) and more, fetching from fork is more efficient, with delta islands.
edited Sep 22 at 16:42
answered Jun 9 '11 at 0:37
VonC
830k28826103156
830k28826103156
6
"When you are cloning a GitHub repo on your local workstation, you cannot contribute back to the upstream repo unless you are explicitly declared as "contributor"." --- Is this not true with "forking"? Please explain.
– chharvey
Aug 3 '13 at 18:16
58
@TestSubject528491 no, with a fork, that means you are cloning the upstream repo as your own repo on the GitHub server side. Then you can locally clone that new "fork" repo on your computer and freely push back on it, since you are the creator and owner of that fork.
– VonC
Aug 3 '13 at 19:00
8
To me, the key point is that you can't submit a PR from your local copy unless you're declared to be a contributor. I'm so used to submitting PRs from my local repo, but that's because I'm always marked as a contributor. If you think about it, to submit a PR you have to push a branch to the remote repo and then create the PR. I guess it makes sense if you don't want random people creating branches on your repo. And that you'd prefer them to fork it and submit PRs that way instead.
– Adam Zerner
Feb 22 '16 at 1:18
I've seen the second "upstream" remote approach elsewhere, but isn't it more straightforward to pull directly from "GitHub - Original" to "GitHub - Fork"? The second remote approach didn't seem to work in my Eclipse and eGit setup, failing to push to my "GitHub - Fork" repo (nothing to push).
– William T. Mallard
Sep 28 '16 at 22:05
Never mind, the info here link gave me some insight. As a contributor it makes sense to pull from "GitHub - Original" to "GitHub - Fork", then from " - Fork" to local machine, but if you're the owner you probably want to pull directly from my " - Fork" first to review, run tests, etc. before pushing to " - Original".
– William T. Mallard
Sep 28 '16 at 22:29
|
show 6 more comments
6
"When you are cloning a GitHub repo on your local workstation, you cannot contribute back to the upstream repo unless you are explicitly declared as "contributor"." --- Is this not true with "forking"? Please explain.
– chharvey
Aug 3 '13 at 18:16
58
@TestSubject528491 no, with a fork, that means you are cloning the upstream repo as your own repo on the GitHub server side. Then you can locally clone that new "fork" repo on your computer and freely push back on it, since you are the creator and owner of that fork.
– VonC
Aug 3 '13 at 19:00
8
To me, the key point is that you can't submit a PR from your local copy unless you're declared to be a contributor. I'm so used to submitting PRs from my local repo, but that's because I'm always marked as a contributor. If you think about it, to submit a PR you have to push a branch to the remote repo and then create the PR. I guess it makes sense if you don't want random people creating branches on your repo. And that you'd prefer them to fork it and submit PRs that way instead.
– Adam Zerner
Feb 22 '16 at 1:18
I've seen the second "upstream" remote approach elsewhere, but isn't it more straightforward to pull directly from "GitHub - Original" to "GitHub - Fork"? The second remote approach didn't seem to work in my Eclipse and eGit setup, failing to push to my "GitHub - Fork" repo (nothing to push).
– William T. Mallard
Sep 28 '16 at 22:05
Never mind, the info here link gave me some insight. As a contributor it makes sense to pull from "GitHub - Original" to "GitHub - Fork", then from " - Fork" to local machine, but if you're the owner you probably want to pull directly from my " - Fork" first to review, run tests, etc. before pushing to " - Original".
– William T. Mallard
Sep 28 '16 at 22:29
6
6
"When you are cloning a GitHub repo on your local workstation, you cannot contribute back to the upstream repo unless you are explicitly declared as "contributor"." --- Is this not true with "forking"? Please explain.
– chharvey
Aug 3 '13 at 18:16
"When you are cloning a GitHub repo on your local workstation, you cannot contribute back to the upstream repo unless you are explicitly declared as "contributor"." --- Is this not true with "forking"? Please explain.
– chharvey
Aug 3 '13 at 18:16
58
58
@TestSubject528491 no, with a fork, that means you are cloning the upstream repo as your own repo on the GitHub server side. Then you can locally clone that new "fork" repo on your computer and freely push back on it, since you are the creator and owner of that fork.
– VonC
Aug 3 '13 at 19:00
@TestSubject528491 no, with a fork, that means you are cloning the upstream repo as your own repo on the GitHub server side. Then you can locally clone that new "fork" repo on your computer and freely push back on it, since you are the creator and owner of that fork.
– VonC
Aug 3 '13 at 19:00
8
8
To me, the key point is that you can't submit a PR from your local copy unless you're declared to be a contributor. I'm so used to submitting PRs from my local repo, but that's because I'm always marked as a contributor. If you think about it, to submit a PR you have to push a branch to the remote repo and then create the PR. I guess it makes sense if you don't want random people creating branches on your repo. And that you'd prefer them to fork it and submit PRs that way instead.
– Adam Zerner
Feb 22 '16 at 1:18
To me, the key point is that you can't submit a PR from your local copy unless you're declared to be a contributor. I'm so used to submitting PRs from my local repo, but that's because I'm always marked as a contributor. If you think about it, to submit a PR you have to push a branch to the remote repo and then create the PR. I guess it makes sense if you don't want random people creating branches on your repo. And that you'd prefer them to fork it and submit PRs that way instead.
– Adam Zerner
Feb 22 '16 at 1:18
I've seen the second "upstream" remote approach elsewhere, but isn't it more straightforward to pull directly from "GitHub - Original" to "GitHub - Fork"? The second remote approach didn't seem to work in my Eclipse and eGit setup, failing to push to my "GitHub - Fork" repo (nothing to push).
– William T. Mallard
Sep 28 '16 at 22:05
I've seen the second "upstream" remote approach elsewhere, but isn't it more straightforward to pull directly from "GitHub - Original" to "GitHub - Fork"? The second remote approach didn't seem to work in my Eclipse and eGit setup, failing to push to my "GitHub - Fork" repo (nothing to push).
– William T. Mallard
Sep 28 '16 at 22:05
Never mind, the info here link gave me some insight. As a contributor it makes sense to pull from "GitHub - Original" to "GitHub - Fork", then from " - Fork" to local machine, but if you're the owner you probably want to pull directly from my " - Fork" first to review, run tests, etc. before pushing to " - Original".
– William T. Mallard
Sep 28 '16 at 22:29
Never mind, the info here link gave me some insight. As a contributor it makes sense to pull from "GitHub - Original" to "GitHub - Fork", then from " - Fork" to local machine, but if you're the owner you probably want to pull directly from my " - Fork" first to review, run tests, etc. before pushing to " - Original".
– William T. Mallard
Sep 28 '16 at 22:29
|
show 6 more comments
I keep hearing people say they're forking code in git. Git "fork" sounds suspiciously like git "clone" plus some (meaningless) psychological willingness to forgo future merges. There is no fork command in git, right?
"Forking" is a concept, not a command specifically supported by any version control system.
The simplest kind of forking is synonymous with branching. Every time you create a branch, regardless of your VCS, you've "forked". These forks are usually pretty easy to merge back together.
The kind of fork you're talking about, where a separate party takes a complete copy of the code and walks away, necessarily happens outside the VCS in a centralized system like Subversion. A distributed VCS like Git has much better support for forking the entire codebase and effectively starting a new project.
Git (not GitHub) natively supports "forking" an entire repo (ie, cloning it) in a couple of ways:
- when you clone, a remote called
origin
is created for you - by default all the branches in the clone will track their
origin
equivalents - fetching and merging changes from the original project you forked from is trivially easy
Git makes contributing changes back to the source of the fork as simple as asking someone from the original project to pull from you, or requesting write access to push changes back yourself. This is the part that GitHub makes easier, and standardizes.
Any angst over Github extending git in this direction? Or any rumors of git absorbing the functionality?
There is no angst because your assumption is wrong. GitHub "extends" the forking functionality of Git with a nice GUI and a standardized way of issuing pull requests, but it doesn't add the functionality to Git. The concept of full-repo-forking is baked right into distributed version control at a fundamental level. You could abandon GitHub at any point and still continue to push/pull projects you've "forked".
5
Thanks for your excellent answer. I just want to clarify, this means, outside the context of github I could clone someX project
on my machine. If I make changes in my local and don't have write access to origin, I will email the author of the project to request a pull. He will make a remote called gideon which will be a url to my local clone, and he can pull, right?
– gideon
Sep 16 '13 at 7:51
1
If you want to contribute your changes to a project you can either save them into files e.g. using git format-patch and attach them to an email to someone who has that write access, or you can obtain your own hosting, push your work to that and send the URL in an email e.g. using the git request-pull command. Repos on workstations are not usually direclty accessible online.
– bdsl
Jan 25 '16 at 11:11
But yes, if your workstation happens to be accessible over the internet to the author of the project then you can simply send the URL to them and they can add it as a remote and pull from it.
– bdsl
Jan 25 '16 at 11:12
1
Re: angst, the only such for me is that there's no link or button to click to create a pull-from-my-repo's-perspective button where GitHub tells you you're 50 commits behind. No biggie now that I know they're using the term "Pull Request" to also include requests for pulling from the upstream to your GitHub fork. Git is hard.
– William T. Mallard
Sep 28 '16 at 22:10
add a comment |
I keep hearing people say they're forking code in git. Git "fork" sounds suspiciously like git "clone" plus some (meaningless) psychological willingness to forgo future merges. There is no fork command in git, right?
"Forking" is a concept, not a command specifically supported by any version control system.
The simplest kind of forking is synonymous with branching. Every time you create a branch, regardless of your VCS, you've "forked". These forks are usually pretty easy to merge back together.
The kind of fork you're talking about, where a separate party takes a complete copy of the code and walks away, necessarily happens outside the VCS in a centralized system like Subversion. A distributed VCS like Git has much better support for forking the entire codebase and effectively starting a new project.
Git (not GitHub) natively supports "forking" an entire repo (ie, cloning it) in a couple of ways:
- when you clone, a remote called
origin
is created for you - by default all the branches in the clone will track their
origin
equivalents - fetching and merging changes from the original project you forked from is trivially easy
Git makes contributing changes back to the source of the fork as simple as asking someone from the original project to pull from you, or requesting write access to push changes back yourself. This is the part that GitHub makes easier, and standardizes.
Any angst over Github extending git in this direction? Or any rumors of git absorbing the functionality?
There is no angst because your assumption is wrong. GitHub "extends" the forking functionality of Git with a nice GUI and a standardized way of issuing pull requests, but it doesn't add the functionality to Git. The concept of full-repo-forking is baked right into distributed version control at a fundamental level. You could abandon GitHub at any point and still continue to push/pull projects you've "forked".
5
Thanks for your excellent answer. I just want to clarify, this means, outside the context of github I could clone someX project
on my machine. If I make changes in my local and don't have write access to origin, I will email the author of the project to request a pull. He will make a remote called gideon which will be a url to my local clone, and he can pull, right?
– gideon
Sep 16 '13 at 7:51
1
If you want to contribute your changes to a project you can either save them into files e.g. using git format-patch and attach them to an email to someone who has that write access, or you can obtain your own hosting, push your work to that and send the URL in an email e.g. using the git request-pull command. Repos on workstations are not usually direclty accessible online.
– bdsl
Jan 25 '16 at 11:11
But yes, if your workstation happens to be accessible over the internet to the author of the project then you can simply send the URL to them and they can add it as a remote and pull from it.
– bdsl
Jan 25 '16 at 11:12
1
Re: angst, the only such for me is that there's no link or button to click to create a pull-from-my-repo's-perspective button where GitHub tells you you're 50 commits behind. No biggie now that I know they're using the term "Pull Request" to also include requests for pulling from the upstream to your GitHub fork. Git is hard.
– William T. Mallard
Sep 28 '16 at 22:10
add a comment |
I keep hearing people say they're forking code in git. Git "fork" sounds suspiciously like git "clone" plus some (meaningless) psychological willingness to forgo future merges. There is no fork command in git, right?
"Forking" is a concept, not a command specifically supported by any version control system.
The simplest kind of forking is synonymous with branching. Every time you create a branch, regardless of your VCS, you've "forked". These forks are usually pretty easy to merge back together.
The kind of fork you're talking about, where a separate party takes a complete copy of the code and walks away, necessarily happens outside the VCS in a centralized system like Subversion. A distributed VCS like Git has much better support for forking the entire codebase and effectively starting a new project.
Git (not GitHub) natively supports "forking" an entire repo (ie, cloning it) in a couple of ways:
- when you clone, a remote called
origin
is created for you - by default all the branches in the clone will track their
origin
equivalents - fetching and merging changes from the original project you forked from is trivially easy
Git makes contributing changes back to the source of the fork as simple as asking someone from the original project to pull from you, or requesting write access to push changes back yourself. This is the part that GitHub makes easier, and standardizes.
Any angst over Github extending git in this direction? Or any rumors of git absorbing the functionality?
There is no angst because your assumption is wrong. GitHub "extends" the forking functionality of Git with a nice GUI and a standardized way of issuing pull requests, but it doesn't add the functionality to Git. The concept of full-repo-forking is baked right into distributed version control at a fundamental level. You could abandon GitHub at any point and still continue to push/pull projects you've "forked".
I keep hearing people say they're forking code in git. Git "fork" sounds suspiciously like git "clone" plus some (meaningless) psychological willingness to forgo future merges. There is no fork command in git, right?
"Forking" is a concept, not a command specifically supported by any version control system.
The simplest kind of forking is synonymous with branching. Every time you create a branch, regardless of your VCS, you've "forked". These forks are usually pretty easy to merge back together.
The kind of fork you're talking about, where a separate party takes a complete copy of the code and walks away, necessarily happens outside the VCS in a centralized system like Subversion. A distributed VCS like Git has much better support for forking the entire codebase and effectively starting a new project.
Git (not GitHub) natively supports "forking" an entire repo (ie, cloning it) in a couple of ways:
- when you clone, a remote called
origin
is created for you - by default all the branches in the clone will track their
origin
equivalents - fetching and merging changes from the original project you forked from is trivially easy
Git makes contributing changes back to the source of the fork as simple as asking someone from the original project to pull from you, or requesting write access to push changes back yourself. This is the part that GitHub makes easier, and standardizes.
Any angst over Github extending git in this direction? Or any rumors of git absorbing the functionality?
There is no angst because your assumption is wrong. GitHub "extends" the forking functionality of Git with a nice GUI and a standardized way of issuing pull requests, but it doesn't add the functionality to Git. The concept of full-repo-forking is baked right into distributed version control at a fundamental level. You could abandon GitHub at any point and still continue to push/pull projects you've "forked".
edited Nov 13 at 20:58
Al Sweigart
4,40723045
4,40723045
answered Jun 9 '11 at 15:59
meagar♦
177k29272288
177k29272288
5
Thanks for your excellent answer. I just want to clarify, this means, outside the context of github I could clone someX project
on my machine. If I make changes in my local and don't have write access to origin, I will email the author of the project to request a pull. He will make a remote called gideon which will be a url to my local clone, and he can pull, right?
– gideon
Sep 16 '13 at 7:51
1
If you want to contribute your changes to a project you can either save them into files e.g. using git format-patch and attach them to an email to someone who has that write access, or you can obtain your own hosting, push your work to that and send the URL in an email e.g. using the git request-pull command. Repos on workstations are not usually direclty accessible online.
– bdsl
Jan 25 '16 at 11:11
But yes, if your workstation happens to be accessible over the internet to the author of the project then you can simply send the URL to them and they can add it as a remote and pull from it.
– bdsl
Jan 25 '16 at 11:12
1
Re: angst, the only such for me is that there's no link or button to click to create a pull-from-my-repo's-perspective button where GitHub tells you you're 50 commits behind. No biggie now that I know they're using the term "Pull Request" to also include requests for pulling from the upstream to your GitHub fork. Git is hard.
– William T. Mallard
Sep 28 '16 at 22:10
add a comment |
5
Thanks for your excellent answer. I just want to clarify, this means, outside the context of github I could clone someX project
on my machine. If I make changes in my local and don't have write access to origin, I will email the author of the project to request a pull. He will make a remote called gideon which will be a url to my local clone, and he can pull, right?
– gideon
Sep 16 '13 at 7:51
1
If you want to contribute your changes to a project you can either save them into files e.g. using git format-patch and attach them to an email to someone who has that write access, or you can obtain your own hosting, push your work to that and send the URL in an email e.g. using the git request-pull command. Repos on workstations are not usually direclty accessible online.
– bdsl
Jan 25 '16 at 11:11
But yes, if your workstation happens to be accessible over the internet to the author of the project then you can simply send the URL to them and they can add it as a remote and pull from it.
– bdsl
Jan 25 '16 at 11:12
1
Re: angst, the only such for me is that there's no link or button to click to create a pull-from-my-repo's-perspective button where GitHub tells you you're 50 commits behind. No biggie now that I know they're using the term "Pull Request" to also include requests for pulling from the upstream to your GitHub fork. Git is hard.
– William T. Mallard
Sep 28 '16 at 22:10
5
5
Thanks for your excellent answer. I just want to clarify, this means, outside the context of github I could clone some
X project
on my machine. If I make changes in my local and don't have write access to origin, I will email the author of the project to request a pull. He will make a remote called gideon which will be a url to my local clone, and he can pull, right?– gideon
Sep 16 '13 at 7:51
Thanks for your excellent answer. I just want to clarify, this means, outside the context of github I could clone some
X project
on my machine. If I make changes in my local and don't have write access to origin, I will email the author of the project to request a pull. He will make a remote called gideon which will be a url to my local clone, and he can pull, right?– gideon
Sep 16 '13 at 7:51
1
1
If you want to contribute your changes to a project you can either save them into files e.g. using git format-patch and attach them to an email to someone who has that write access, or you can obtain your own hosting, push your work to that and send the URL in an email e.g. using the git request-pull command. Repos on workstations are not usually direclty accessible online.
– bdsl
Jan 25 '16 at 11:11
If you want to contribute your changes to a project you can either save them into files e.g. using git format-patch and attach them to an email to someone who has that write access, or you can obtain your own hosting, push your work to that and send the URL in an email e.g. using the git request-pull command. Repos on workstations are not usually direclty accessible online.
– bdsl
Jan 25 '16 at 11:11
But yes, if your workstation happens to be accessible over the internet to the author of the project then you can simply send the URL to them and they can add it as a remote and pull from it.
– bdsl
Jan 25 '16 at 11:12
But yes, if your workstation happens to be accessible over the internet to the author of the project then you can simply send the URL to them and they can add it as a remote and pull from it.
– bdsl
Jan 25 '16 at 11:12
1
1
Re: angst, the only such for me is that there's no link or button to click to create a pull-from-my-repo's-perspective button where GitHub tells you you're 50 commits behind. No biggie now that I know they're using the term "Pull Request" to also include requests for pulling from the upstream to your GitHub fork. Git is hard.
– William T. Mallard
Sep 28 '16 at 22:10
Re: angst, the only such for me is that there's no link or button to click to create a pull-from-my-repo's-perspective button where GitHub tells you you're 50 commits behind. No biggie now that I know they're using the term "Pull Request" to also include requests for pulling from the upstream to your GitHub fork. Git is hard.
– William T. Mallard
Sep 28 '16 at 22:10
add a comment |
Yes Fork is a clone. It emerged because, you cannot push to others' copies without their permission. What they do is make a copy of it for you (fork), where you will have write permission as well.
In the future if the actual owner or others users with a fork like your changes they can pull it back to their own repo. Alternatively you can send them a "pull-request".
Can I simply clone the repository to my local machine, create a branch, then submit a pull request to the original owner? It seems redundant to have multiple copies of repos hosted all over GitHub, just to facilitate code updates.
– Casey
Sep 1 '15 at 12:57
4
@Casey You can only send a pull request through GitHub from GitHub itself and you can only send a GitHub pull request from a branch that exists on GitHub. If you are not a collaborator on the Repository in question, there is no way for you to create a branch from which you can initiate a GitHub pull request. Nothing stops you from doing it via email the old fashioned way, but GitHub plays no part in that.
– Beau Simensen
Sep 6 '15 at 20:24
2
@Casey, a reason is that normally others do not have URL access to your workstation. The GitHubfork
means there is a copy of your work on the GitHub server, that you canpush
to and which others do have URL access to so they canpull
. Thepull request
is just a standard way to getting the URL for your copy (up on GitHub) to them so they can easily pull it into the their repository.
– Jesse Chisholm
Jun 13 '16 at 23:19
This should be the correct/accepted answer I believe. Imagine a mess in a scene where a team of 15-20 developers creating branches and pushing to origin versus 15-20 developers having their own copy of same repository and making as many branches and doing changes and pushing it back. Then Author of original repository can pull only changes he/she wants.
– Kishor Pawar
Jul 19 '16 at 7:31
add a comment |
Yes Fork is a clone. It emerged because, you cannot push to others' copies without their permission. What they do is make a copy of it for you (fork), where you will have write permission as well.
In the future if the actual owner or others users with a fork like your changes they can pull it back to their own repo. Alternatively you can send them a "pull-request".
Can I simply clone the repository to my local machine, create a branch, then submit a pull request to the original owner? It seems redundant to have multiple copies of repos hosted all over GitHub, just to facilitate code updates.
– Casey
Sep 1 '15 at 12:57
4
@Casey You can only send a pull request through GitHub from GitHub itself and you can only send a GitHub pull request from a branch that exists on GitHub. If you are not a collaborator on the Repository in question, there is no way for you to create a branch from which you can initiate a GitHub pull request. Nothing stops you from doing it via email the old fashioned way, but GitHub plays no part in that.
– Beau Simensen
Sep 6 '15 at 20:24
2
@Casey, a reason is that normally others do not have URL access to your workstation. The GitHubfork
means there is a copy of your work on the GitHub server, that you canpush
to and which others do have URL access to so they canpull
. Thepull request
is just a standard way to getting the URL for your copy (up on GitHub) to them so they can easily pull it into the their repository.
– Jesse Chisholm
Jun 13 '16 at 23:19
This should be the correct/accepted answer I believe. Imagine a mess in a scene where a team of 15-20 developers creating branches and pushing to origin versus 15-20 developers having their own copy of same repository and making as many branches and doing changes and pushing it back. Then Author of original repository can pull only changes he/she wants.
– Kishor Pawar
Jul 19 '16 at 7:31
add a comment |
Yes Fork is a clone. It emerged because, you cannot push to others' copies without their permission. What they do is make a copy of it for you (fork), where you will have write permission as well.
In the future if the actual owner or others users with a fork like your changes they can pull it back to their own repo. Alternatively you can send them a "pull-request".
Yes Fork is a clone. It emerged because, you cannot push to others' copies without their permission. What they do is make a copy of it for you (fork), where you will have write permission as well.
In the future if the actual owner or others users with a fork like your changes they can pull it back to their own repo. Alternatively you can send them a "pull-request".
edited May 10 '12 at 3:35
copolii
9,09684169
9,09684169
answered Jun 9 '11 at 21:12
ssapkota
2,8091528
2,8091528
Can I simply clone the repository to my local machine, create a branch, then submit a pull request to the original owner? It seems redundant to have multiple copies of repos hosted all over GitHub, just to facilitate code updates.
– Casey
Sep 1 '15 at 12:57
4
@Casey You can only send a pull request through GitHub from GitHub itself and you can only send a GitHub pull request from a branch that exists on GitHub. If you are not a collaborator on the Repository in question, there is no way for you to create a branch from which you can initiate a GitHub pull request. Nothing stops you from doing it via email the old fashioned way, but GitHub plays no part in that.
– Beau Simensen
Sep 6 '15 at 20:24
2
@Casey, a reason is that normally others do not have URL access to your workstation. The GitHubfork
means there is a copy of your work on the GitHub server, that you canpush
to and which others do have URL access to so they canpull
. Thepull request
is just a standard way to getting the URL for your copy (up on GitHub) to them so they can easily pull it into the their repository.
– Jesse Chisholm
Jun 13 '16 at 23:19
This should be the correct/accepted answer I believe. Imagine a mess in a scene where a team of 15-20 developers creating branches and pushing to origin versus 15-20 developers having their own copy of same repository and making as many branches and doing changes and pushing it back. Then Author of original repository can pull only changes he/she wants.
– Kishor Pawar
Jul 19 '16 at 7:31
add a comment |
Can I simply clone the repository to my local machine, create a branch, then submit a pull request to the original owner? It seems redundant to have multiple copies of repos hosted all over GitHub, just to facilitate code updates.
– Casey
Sep 1 '15 at 12:57
4
@Casey You can only send a pull request through GitHub from GitHub itself and you can only send a GitHub pull request from a branch that exists on GitHub. If you are not a collaborator on the Repository in question, there is no way for you to create a branch from which you can initiate a GitHub pull request. Nothing stops you from doing it via email the old fashioned way, but GitHub plays no part in that.
– Beau Simensen
Sep 6 '15 at 20:24
2
@Casey, a reason is that normally others do not have URL access to your workstation. The GitHubfork
means there is a copy of your work on the GitHub server, that you canpush
to and which others do have URL access to so they canpull
. Thepull request
is just a standard way to getting the URL for your copy (up on GitHub) to them so they can easily pull it into the their repository.
– Jesse Chisholm
Jun 13 '16 at 23:19
This should be the correct/accepted answer I believe. Imagine a mess in a scene where a team of 15-20 developers creating branches and pushing to origin versus 15-20 developers having their own copy of same repository and making as many branches and doing changes and pushing it back. Then Author of original repository can pull only changes he/she wants.
– Kishor Pawar
Jul 19 '16 at 7:31
Can I simply clone the repository to my local machine, create a branch, then submit a pull request to the original owner? It seems redundant to have multiple copies of repos hosted all over GitHub, just to facilitate code updates.
– Casey
Sep 1 '15 at 12:57
Can I simply clone the repository to my local machine, create a branch, then submit a pull request to the original owner? It seems redundant to have multiple copies of repos hosted all over GitHub, just to facilitate code updates.
– Casey
Sep 1 '15 at 12:57
4
4
@Casey You can only send a pull request through GitHub from GitHub itself and you can only send a GitHub pull request from a branch that exists on GitHub. If you are not a collaborator on the Repository in question, there is no way for you to create a branch from which you can initiate a GitHub pull request. Nothing stops you from doing it via email the old fashioned way, but GitHub plays no part in that.
– Beau Simensen
Sep 6 '15 at 20:24
@Casey You can only send a pull request through GitHub from GitHub itself and you can only send a GitHub pull request from a branch that exists on GitHub. If you are not a collaborator on the Repository in question, there is no way for you to create a branch from which you can initiate a GitHub pull request. Nothing stops you from doing it via email the old fashioned way, but GitHub plays no part in that.
– Beau Simensen
Sep 6 '15 at 20:24
2
2
@Casey, a reason is that normally others do not have URL access to your workstation. The GitHub
fork
means there is a copy of your work on the GitHub server, that you can push
to and which others do have URL access to so they can pull
. The pull request
is just a standard way to getting the URL for your copy (up on GitHub) to them so they can easily pull it into the their repository.– Jesse Chisholm
Jun 13 '16 at 23:19
@Casey, a reason is that normally others do not have URL access to your workstation. The GitHub
fork
means there is a copy of your work on the GitHub server, that you can push
to and which others do have URL access to so they can pull
. The pull request
is just a standard way to getting the URL for your copy (up on GitHub) to them so they can easily pull it into the their repository.– Jesse Chisholm
Jun 13 '16 at 23:19
This should be the correct/accepted answer I believe. Imagine a mess in a scene where a team of 15-20 developers creating branches and pushing to origin versus 15-20 developers having their own copy of same repository and making as many branches and doing changes and pushing it back. Then Author of original repository can pull only changes he/she wants.
– Kishor Pawar
Jul 19 '16 at 7:31
This should be the correct/accepted answer I believe. Imagine a mess in a scene where a team of 15-20 developers creating branches and pushing to origin versus 15-20 developers having their own copy of same repository and making as many branches and doing changes and pushing it back. Then Author of original repository can pull only changes he/she wants.
– Kishor Pawar
Jul 19 '16 at 7:31
add a comment |
"Fork" in this context means "Make a copy of their code so that I can add my own modifications". There's not much else to say. Every clone is essentially a fork, and it's up to the original to decide whether to pull the changes from the fork.
2
In specific: "Make a copy of their codeon the GitHub server
so that I can add my own modificationsand others can have URL access to my version
". Most local workstations do not offer URL access for anyone to be able to pull. But if you push to your fork on the server, then they can have the URL for the pull.
– Jesse Chisholm
Jun 13 '16 at 23:21
The question is not about forking is in general, but about the GitHub forking specifically.
– reinierpost
Jun 8 '17 at 8:46
add a comment |
"Fork" in this context means "Make a copy of their code so that I can add my own modifications". There's not much else to say. Every clone is essentially a fork, and it's up to the original to decide whether to pull the changes from the fork.
2
In specific: "Make a copy of their codeon the GitHub server
so that I can add my own modificationsand others can have URL access to my version
". Most local workstations do not offer URL access for anyone to be able to pull. But if you push to your fork on the server, then they can have the URL for the pull.
– Jesse Chisholm
Jun 13 '16 at 23:21
The question is not about forking is in general, but about the GitHub forking specifically.
– reinierpost
Jun 8 '17 at 8:46
add a comment |
"Fork" in this context means "Make a copy of their code so that I can add my own modifications". There's not much else to say. Every clone is essentially a fork, and it's up to the original to decide whether to pull the changes from the fork.
"Fork" in this context means "Make a copy of their code so that I can add my own modifications". There's not much else to say. Every clone is essentially a fork, and it's up to the original to decide whether to pull the changes from the fork.
answered Jun 8 '11 at 23:51
Daenyth
23.8k863103
23.8k863103
2
In specific: "Make a copy of their codeon the GitHub server
so that I can add my own modificationsand others can have URL access to my version
". Most local workstations do not offer URL access for anyone to be able to pull. But if you push to your fork on the server, then they can have the URL for the pull.
– Jesse Chisholm
Jun 13 '16 at 23:21
The question is not about forking is in general, but about the GitHub forking specifically.
– reinierpost
Jun 8 '17 at 8:46
add a comment |
2
In specific: "Make a copy of their codeon the GitHub server
so that I can add my own modificationsand others can have URL access to my version
". Most local workstations do not offer URL access for anyone to be able to pull. But if you push to your fork on the server, then they can have the URL for the pull.
– Jesse Chisholm
Jun 13 '16 at 23:21
The question is not about forking is in general, but about the GitHub forking specifically.
– reinierpost
Jun 8 '17 at 8:46
2
2
In specific: "Make a copy of their code
on the GitHub server
so that I can add my own modifications and others can have URL access to my version
". Most local workstations do not offer URL access for anyone to be able to pull. But if you push to your fork on the server, then they can have the URL for the pull.– Jesse Chisholm
Jun 13 '16 at 23:21
In specific: "Make a copy of their code
on the GitHub server
so that I can add my own modifications and others can have URL access to my version
". Most local workstations do not offer URL access for anyone to be able to pull. But if you push to your fork on the server, then they can have the URL for the pull.– Jesse Chisholm
Jun 13 '16 at 23:21
The question is not about forking is in general, but about the GitHub forking specifically.
– reinierpost
Jun 8 '17 at 8:46
The question is not about forking is in general, but about the GitHub forking specifically.
– reinierpost
Jun 8 '17 at 8:46
add a comment |
Cloning involves making a copy of the git repository to a local machine, while forking is cloning the repository into another repository. Cloning is for personal use only (although future merges may occur), but with forking you are copying and opening a new possible project path
add a comment |
Cloning involves making a copy of the git repository to a local machine, while forking is cloning the repository into another repository. Cloning is for personal use only (although future merges may occur), but with forking you are copying and opening a new possible project path
add a comment |
Cloning involves making a copy of the git repository to a local machine, while forking is cloning the repository into another repository. Cloning is for personal use only (although future merges may occur), but with forking you are copying and opening a new possible project path
Cloning involves making a copy of the git repository to a local machine, while forking is cloning the repository into another repository. Cloning is for personal use only (although future merges may occur), but with forking you are copying and opening a new possible project path
answered Jun 9 '11 at 0:24
Sam Johnson
5871918
5871918
add a comment |
add a comment |
I think fork is a copy of other repository but with your account modification. for example, if you directly clone other repository locally, the remote object origin is still using the account who you clone from. You can't commit and contribute your code. It is just a pure copy of codes. Otherwise, If you fork a repository, it will clone the repo with the update of your account setting in you github account. And then cloning the repo in the context of your account, you can commit your codes.
add a comment |
I think fork is a copy of other repository but with your account modification. for example, if you directly clone other repository locally, the remote object origin is still using the account who you clone from. You can't commit and contribute your code. It is just a pure copy of codes. Otherwise, If you fork a repository, it will clone the repo with the update of your account setting in you github account. And then cloning the repo in the context of your account, you can commit your codes.
add a comment |
I think fork is a copy of other repository but with your account modification. for example, if you directly clone other repository locally, the remote object origin is still using the account who you clone from. You can't commit and contribute your code. It is just a pure copy of codes. Otherwise, If you fork a repository, it will clone the repo with the update of your account setting in you github account. And then cloning the repo in the context of your account, you can commit your codes.
I think fork is a copy of other repository but with your account modification. for example, if you directly clone other repository locally, the remote object origin is still using the account who you clone from. You can't commit and contribute your code. It is just a pure copy of codes. Otherwise, If you fork a repository, it will clone the repo with the update of your account setting in you github account. And then cloning the repo in the context of your account, you can commit your codes.
answered Jun 4 '13 at 19:30
Daniel Shen
2,5031913
2,5031913
add a comment |
add a comment |
Forking is done when you decide to contribute to some project. You would make a copy of the entire project along with its history logs. This copy is made entirely in your repository and once you make these changes, you issue a pull request. Now its up-to the owner of the source to accept your pull request and incorporate the changes into the original code.
Git clone is an actual command that allows users to get a copy of the source.
git clone [URL]
This should create a copy of [URL] in your own local repository.
add a comment |
Forking is done when you decide to contribute to some project. You would make a copy of the entire project along with its history logs. This copy is made entirely in your repository and once you make these changes, you issue a pull request. Now its up-to the owner of the source to accept your pull request and incorporate the changes into the original code.
Git clone is an actual command that allows users to get a copy of the source.
git clone [URL]
This should create a copy of [URL] in your own local repository.
add a comment |
Forking is done when you decide to contribute to some project. You would make a copy of the entire project along with its history logs. This copy is made entirely in your repository and once you make these changes, you issue a pull request. Now its up-to the owner of the source to accept your pull request and incorporate the changes into the original code.
Git clone is an actual command that allows users to get a copy of the source.
git clone [URL]
This should create a copy of [URL] in your own local repository.
Forking is done when you decide to contribute to some project. You would make a copy of the entire project along with its history logs. This copy is made entirely in your repository and once you make these changes, you issue a pull request. Now its up-to the owner of the source to accept your pull request and incorporate the changes into the original code.
Git clone is an actual command that allows users to get a copy of the source.
git clone [URL]
This should create a copy of [URL] in your own local repository.
answered Jun 11 '14 at 18:40
aliasav
1,6721426
1,6721426
add a comment |
add a comment |
Apart from the fact that cloning is from server to your machine and forking is making a copy on the server itself, an important difference is that when we clone, we actually get all the branches, labels, etc. But when we fork, we actually only get the current files in the master branch, nothing other than that. This means we don't get the other branches, etc.
Hence if you have to merge something back to the original repo, it is a inter-repo merge and will definitely need higher privileges.
Fork is not a command in git, it is just a concept which Github implements. Remember Git was designed to work in peer to peer environment without the need to synchronize stuff with any master copy. The server is just another peer but we look at it as a master copy.
5
Huh? A fork gets all the branches, though you have to know where to look (hint:git branch -a
).
– tripleee
Jan 12 '16 at 5:52
add a comment |
Apart from the fact that cloning is from server to your machine and forking is making a copy on the server itself, an important difference is that when we clone, we actually get all the branches, labels, etc. But when we fork, we actually only get the current files in the master branch, nothing other than that. This means we don't get the other branches, etc.
Hence if you have to merge something back to the original repo, it is a inter-repo merge and will definitely need higher privileges.
Fork is not a command in git, it is just a concept which Github implements. Remember Git was designed to work in peer to peer environment without the need to synchronize stuff with any master copy. The server is just another peer but we look at it as a master copy.
5
Huh? A fork gets all the branches, though you have to know where to look (hint:git branch -a
).
– tripleee
Jan 12 '16 at 5:52
add a comment |
Apart from the fact that cloning is from server to your machine and forking is making a copy on the server itself, an important difference is that when we clone, we actually get all the branches, labels, etc. But when we fork, we actually only get the current files in the master branch, nothing other than that. This means we don't get the other branches, etc.
Hence if you have to merge something back to the original repo, it is a inter-repo merge and will definitely need higher privileges.
Fork is not a command in git, it is just a concept which Github implements. Remember Git was designed to work in peer to peer environment without the need to synchronize stuff with any master copy. The server is just another peer but we look at it as a master copy.
Apart from the fact that cloning is from server to your machine and forking is making a copy on the server itself, an important difference is that when we clone, we actually get all the branches, labels, etc. But when we fork, we actually only get the current files in the master branch, nothing other than that. This means we don't get the other branches, etc.
Hence if you have to merge something back to the original repo, it is a inter-repo merge and will definitely need higher privileges.
Fork is not a command in git, it is just a concept which Github implements. Remember Git was designed to work in peer to peer environment without the need to synchronize stuff with any master copy. The server is just another peer but we look at it as a master copy.
answered Apr 23 '15 at 5:51
Deepak G M
1,4351512
1,4351512
5
Huh? A fork gets all the branches, though you have to know where to look (hint:git branch -a
).
– tripleee
Jan 12 '16 at 5:52
add a comment |
5
Huh? A fork gets all the branches, though you have to know where to look (hint:git branch -a
).
– tripleee
Jan 12 '16 at 5:52
5
5
Huh? A fork gets all the branches, though you have to know where to look (hint:
git branch -a
).– tripleee
Jan 12 '16 at 5:52
Huh? A fork gets all the branches, though you have to know where to look (hint:
git branch -a
).– tripleee
Jan 12 '16 at 5:52
add a comment |
There is a misunderstanding here with respect to what a "fork" is. A fork is in fact nothing more than a set of per-user branches. When you push to a fork you actually do push to the original repo because that is the ONLY repo.
You can try this out by pushing to a fork, noting the commit and then going to the original repo and using the commit ID, you'll see that the commit is "in" the original repo.
This makes a lot of sense but is far from obvious (I only discovered this accidentally recently).
When John forks repo SuperProject what seems to actually happen is that all branches in the source repo are replicated with a name like "John.master" and "John.new_gui_project" etc.
Github "hides" the "John." from us and gives us the illusion we have our own "copy" of the repo in Github, but we don't and nor is one even needed.
So my fork's branch "master" is actually named "Korporal.master" but the Github UI never reveals this, showing me only "master".
This is pretty much what I think goes on under the hood anyway based on stuff I've been doing recently and when you ponder it, is very good design.
For this reason I think it would be very easy for Microsoft to implement Git forks in their Visual Studio Team services offering.
Dear Hugh, half of your response is actually incorrect -- a fork is a clone of a whole repository from one user account to another user account, together with all the branches and history. When you commit to the fork, nothing changes in the original repository from which you forked. But besides these few misunderstandings on your part regarding what a "fork" is, there is now some good news: Visual Studio Team services include now a "Fork" functionality. ;)
– Sorin Postelnicu
Jan 11 at 23:01
1
@SorinPostelnicu source? I'm inclined to believe Hugh here due to personal experience of forks behaving in ways that are inconstant with them being a simple clone of the repository. For example, when upstream is deleted, forks are deleted (as was mentioned in a comment on OP's question) and sometimes upstream has wound up merging things into branches of my forks when accepting a pull request, without me doing anything.
– potato
Feb 15 at 3:12
Indeed this appears to be the case. After all it would be incredibly stupid for GitHub to literallygit clone
a whole new repository (even a "bare" one) every time someone pushes the "fork" button -- that would be an incredible waste of storage, and likely an attack vector as well.
– Greg A. Woods
Mar 23 at 23:37
add a comment |
There is a misunderstanding here with respect to what a "fork" is. A fork is in fact nothing more than a set of per-user branches. When you push to a fork you actually do push to the original repo because that is the ONLY repo.
You can try this out by pushing to a fork, noting the commit and then going to the original repo and using the commit ID, you'll see that the commit is "in" the original repo.
This makes a lot of sense but is far from obvious (I only discovered this accidentally recently).
When John forks repo SuperProject what seems to actually happen is that all branches in the source repo are replicated with a name like "John.master" and "John.new_gui_project" etc.
Github "hides" the "John." from us and gives us the illusion we have our own "copy" of the repo in Github, but we don't and nor is one even needed.
So my fork's branch "master" is actually named "Korporal.master" but the Github UI never reveals this, showing me only "master".
This is pretty much what I think goes on under the hood anyway based on stuff I've been doing recently and when you ponder it, is very good design.
For this reason I think it would be very easy for Microsoft to implement Git forks in their Visual Studio Team services offering.
Dear Hugh, half of your response is actually incorrect -- a fork is a clone of a whole repository from one user account to another user account, together with all the branches and history. When you commit to the fork, nothing changes in the original repository from which you forked. But besides these few misunderstandings on your part regarding what a "fork" is, there is now some good news: Visual Studio Team services include now a "Fork" functionality. ;)
– Sorin Postelnicu
Jan 11 at 23:01
1
@SorinPostelnicu source? I'm inclined to believe Hugh here due to personal experience of forks behaving in ways that are inconstant with them being a simple clone of the repository. For example, when upstream is deleted, forks are deleted (as was mentioned in a comment on OP's question) and sometimes upstream has wound up merging things into branches of my forks when accepting a pull request, without me doing anything.
– potato
Feb 15 at 3:12
Indeed this appears to be the case. After all it would be incredibly stupid for GitHub to literallygit clone
a whole new repository (even a "bare" one) every time someone pushes the "fork" button -- that would be an incredible waste of storage, and likely an attack vector as well.
– Greg A. Woods
Mar 23 at 23:37
add a comment |
There is a misunderstanding here with respect to what a "fork" is. A fork is in fact nothing more than a set of per-user branches. When you push to a fork you actually do push to the original repo because that is the ONLY repo.
You can try this out by pushing to a fork, noting the commit and then going to the original repo and using the commit ID, you'll see that the commit is "in" the original repo.
This makes a lot of sense but is far from obvious (I only discovered this accidentally recently).
When John forks repo SuperProject what seems to actually happen is that all branches in the source repo are replicated with a name like "John.master" and "John.new_gui_project" etc.
Github "hides" the "John." from us and gives us the illusion we have our own "copy" of the repo in Github, but we don't and nor is one even needed.
So my fork's branch "master" is actually named "Korporal.master" but the Github UI never reveals this, showing me only "master".
This is pretty much what I think goes on under the hood anyway based on stuff I've been doing recently and when you ponder it, is very good design.
For this reason I think it would be very easy for Microsoft to implement Git forks in their Visual Studio Team services offering.
There is a misunderstanding here with respect to what a "fork" is. A fork is in fact nothing more than a set of per-user branches. When you push to a fork you actually do push to the original repo because that is the ONLY repo.
You can try this out by pushing to a fork, noting the commit and then going to the original repo and using the commit ID, you'll see that the commit is "in" the original repo.
This makes a lot of sense but is far from obvious (I only discovered this accidentally recently).
When John forks repo SuperProject what seems to actually happen is that all branches in the source repo are replicated with a name like "John.master" and "John.new_gui_project" etc.
Github "hides" the "John." from us and gives us the illusion we have our own "copy" of the repo in Github, but we don't and nor is one even needed.
So my fork's branch "master" is actually named "Korporal.master" but the Github UI never reveals this, showing me only "master".
This is pretty much what I think goes on under the hood anyway based on stuff I've been doing recently and when you ponder it, is very good design.
For this reason I think it would be very easy for Microsoft to implement Git forks in their Visual Studio Team services offering.
answered Aug 26 '17 at 18:38
Hugh
44246
44246
Dear Hugh, half of your response is actually incorrect -- a fork is a clone of a whole repository from one user account to another user account, together with all the branches and history. When you commit to the fork, nothing changes in the original repository from which you forked. But besides these few misunderstandings on your part regarding what a "fork" is, there is now some good news: Visual Studio Team services include now a "Fork" functionality. ;)
– Sorin Postelnicu
Jan 11 at 23:01
1
@SorinPostelnicu source? I'm inclined to believe Hugh here due to personal experience of forks behaving in ways that are inconstant with them being a simple clone of the repository. For example, when upstream is deleted, forks are deleted (as was mentioned in a comment on OP's question) and sometimes upstream has wound up merging things into branches of my forks when accepting a pull request, without me doing anything.
– potato
Feb 15 at 3:12
Indeed this appears to be the case. After all it would be incredibly stupid for GitHub to literallygit clone
a whole new repository (even a "bare" one) every time someone pushes the "fork" button -- that would be an incredible waste of storage, and likely an attack vector as well.
– Greg A. Woods
Mar 23 at 23:37
add a comment |
Dear Hugh, half of your response is actually incorrect -- a fork is a clone of a whole repository from one user account to another user account, together with all the branches and history. When you commit to the fork, nothing changes in the original repository from which you forked. But besides these few misunderstandings on your part regarding what a "fork" is, there is now some good news: Visual Studio Team services include now a "Fork" functionality. ;)
– Sorin Postelnicu
Jan 11 at 23:01
1
@SorinPostelnicu source? I'm inclined to believe Hugh here due to personal experience of forks behaving in ways that are inconstant with them being a simple clone of the repository. For example, when upstream is deleted, forks are deleted (as was mentioned in a comment on OP's question) and sometimes upstream has wound up merging things into branches of my forks when accepting a pull request, without me doing anything.
– potato
Feb 15 at 3:12
Indeed this appears to be the case. After all it would be incredibly stupid for GitHub to literallygit clone
a whole new repository (even a "bare" one) every time someone pushes the "fork" button -- that would be an incredible waste of storage, and likely an attack vector as well.
– Greg A. Woods
Mar 23 at 23:37
Dear Hugh, half of your response is actually incorrect -- a fork is a clone of a whole repository from one user account to another user account, together with all the branches and history. When you commit to the fork, nothing changes in the original repository from which you forked. But besides these few misunderstandings on your part regarding what a "fork" is, there is now some good news: Visual Studio Team services include now a "Fork" functionality. ;)
– Sorin Postelnicu
Jan 11 at 23:01
Dear Hugh, half of your response is actually incorrect -- a fork is a clone of a whole repository from one user account to another user account, together with all the branches and history. When you commit to the fork, nothing changes in the original repository from which you forked. But besides these few misunderstandings on your part regarding what a "fork" is, there is now some good news: Visual Studio Team services include now a "Fork" functionality. ;)
– Sorin Postelnicu
Jan 11 at 23:01
1
1
@SorinPostelnicu source? I'm inclined to believe Hugh here due to personal experience of forks behaving in ways that are inconstant with them being a simple clone of the repository. For example, when upstream is deleted, forks are deleted (as was mentioned in a comment on OP's question) and sometimes upstream has wound up merging things into branches of my forks when accepting a pull request, without me doing anything.
– potato
Feb 15 at 3:12
@SorinPostelnicu source? I'm inclined to believe Hugh here due to personal experience of forks behaving in ways that are inconstant with them being a simple clone of the repository. For example, when upstream is deleted, forks are deleted (as was mentioned in a comment on OP's question) and sometimes upstream has wound up merging things into branches of my forks when accepting a pull request, without me doing anything.
– potato
Feb 15 at 3:12
Indeed this appears to be the case. After all it would be incredibly stupid for GitHub to literally
git clone
a whole new repository (even a "bare" one) every time someone pushes the "fork" button -- that would be an incredible waste of storage, and likely an attack vector as well.– Greg A. Woods
Mar 23 at 23:37
Indeed this appears to be the case. After all it would be incredibly stupid for GitHub to literally
git clone
a whole new repository (even a "bare" one) every time someone pushes the "fork" button -- that would be an incredible waste of storage, and likely an attack vector as well.– Greg A. Woods
Mar 23 at 23:37
add a comment |
In simplest terms,
When you say you are Forking a repository, you are basically creating a copy of the original repository under your GitHub ID in your Github account.
and
When you say you are Cloning a repository, you are creating a local copy of the original repository in your system(pc/lappy) directly without having a copy in your Github account.
add a comment |
In simplest terms,
When you say you are Forking a repository, you are basically creating a copy of the original repository under your GitHub ID in your Github account.
and
When you say you are Cloning a repository, you are creating a local copy of the original repository in your system(pc/lappy) directly without having a copy in your Github account.
add a comment |
In simplest terms,
When you say you are Forking a repository, you are basically creating a copy of the original repository under your GitHub ID in your Github account.
and
When you say you are Cloning a repository, you are creating a local copy of the original repository in your system(pc/lappy) directly without having a copy in your Github account.
In simplest terms,
When you say you are Forking a repository, you are basically creating a copy of the original repository under your GitHub ID in your Github account.
and
When you say you are Cloning a repository, you are creating a local copy of the original repository in your system(pc/lappy) directly without having a copy in your Github account.
answered Oct 4 at 12:42
anoNewb
11414
11414
add a comment |
add a comment |
protected by Tushar Gupta Nov 25 '14 at 7:21
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
8
Yeah, it is just a type of clone which is tracked by the github database.
– Paŭlo Ebermann
Jun 9 '11 at 1:21
14
Doesn't GitHub do something special to avoid doubling the storage requirements (on GitHub's own servers)?
– Keith Thompson
May 10 '12 at 3:44
14
Not mentioned yet: Deleting a private repo deletes all its forks. Deleting a public repo keeps the forks but promotes one fork to be the new parent repo. If your boss makes your public repo private, it breaks all the existing forks and you won't be able to make pull requests from them to the private repo. help.github.com/articles/…
– Plato
Feb 25 '16 at 0:21