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?
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:
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"
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?
I think you have a funny idea of what "forking" means. It 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:
origin
is created for you origin
equivalents 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".
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".
链接地址: http://www.djcxy.com/p/45182.html上一篇: 只在GitHub上发送一个pull请求,仅用于最新的提交
下一篇: git叉子是否是git克隆?