只做瓶子包装设计的创意网站,网上做效果图网站,免费素材网免费素材图库,沈阳网站制作流程Fork#xff0c;本身并不是git工具中的一个命令#xff0c;也不是对git的扩展#xff0c;它是在GitHub上的概念#xff0c;是另一种clone方式——在服务器端的clone。 而我们通常意义上的clone#xff0c;是将远程repo 复制一份到本地。
当你从GitHub上 clone 一个 repo …Fork本身并不是git工具中的一个命令也不是对git的扩展它是在GitHub上的概念是另一种clone方式——在服务器端的clone。 而我们通常意义上的clone是将远程repo 复制一份到本地。
当你从GitHub上 clone 一个 repo 到本地时除非你已明确声明是这个repo的contributor否则你是不能向其pull request的此时该远程的repo对于本地repo来说就是upstream。 当你从GitHub上 fork 一个 repo 之后再 clone forked repo 到本地你就可以任意向其pull request此时远程的 repo 就是 origin。 下面一段是来自 GitHub pages 的解释: When a repo is cloned, it has a default remote called origin that points to your fork on GitHub, not the original repo it was forked from. To keep track of the original repo, you need to add another remote named upstream git remote add upstream git://github.com/user/repo_name.git 总结下来 1. 如果是 upstream repo你只可以拉取最新代码即 git fetch 从而保证你本地的仓库与源仓库同步 2. 如果是 origin repo就是你自己的repo自己创建的或者 fork 的项目你可以做 任何推拉操作pull and push 3. 你可以通过 pull request 向 upstream repo 贡献代码 Referenced by http://stackoverflow.com/questions/6286571/git-fork-is-git-clone In terms of source control, youre downstream when you copy (clone, checkout, etc) from a repository. Information flowed downstream to you.
When you make changes, you usually want to send them back upstream so they make it into that repository so that everyone pulling from the same source is working with all the same changes. This is mostly a social issue of how everyone can coordinate their work rather than a technical requirement of source control. You want to get your changes into the main project so youre not tracking divergent lines of development.
Sometimes youll read about package or release managers (the people, not the tool) talking about submitting changes to upstream. That usually means they had to adjust the original sources so they could create a package for their system. They dont want to keep making those changes, so if they send them upstream to the original source, they shouldnt have to deal with the same issue in the next release.
http://stackoverflow.com/questions/2739376/definition-of-downstream-and-upstream/2749166#2749166 What is the difference between origin and upstream in github?
When a git branch -a command is done, some branches have a prefix of origin(remotes/origin/..) while others have a prefix of upstream (remotes/upstream/..). This should be understood in the context of GitHub forks (where you fork a GitHub repo at GitHub before cloning that fork locally)
upstream generally refers to the original repo that you have forked (see also Definition of “downstream” and “upstream” for more on upstream term)origin is your fork: your own repo on GitHub, clone of the original repo of GitHub
From the GitHub page: When a repo is cloned, it has a default remote called origin that points to your fork on GitHub, not the original repo it was forked from. To keep track of the original repo, you need to add another remote named upstream git remote add upstream git://github.com/user/repo.git
You will use upstream to fetch from the original repo (in order to keep your local copy in sync with the project you want to contribute to).
You will use origin to pull and push since you can contribute to your own repo.
You will contribute back to the upstream repo by making a pull request. http://my.oschina.net/uniquejava/blog/481625