Contributing using git

杀马特。学长 韩版系。学妹 提交于 2019-12-05 01:15:09

When you clone a repository, Git automatically creates remote tracking branches that do what you describe for the master branch. You can list these remote tracking branches with:

git branch -r

Because tracking the upstream repository is already done for you, you would normally use your master branch for mainline changes to the project. Here's what I would do in your particular situation:

  • Merge the myfix branch into master in your clone. (Having done this in a "topic branch" is good practice.)
  • Push the master branch to Github. (It's unclear whether you forked the original repository, or just cloned from it. You will need to fork the original repository, creating your own copy, for the next step to work.)
  • Send a Github pull request to the owner of the repository you forked.

Github lets you send pull requests to owners of other repositories, and a request says where to find your interesting changes. This means you don't have to keep all your changes in a particular well-known branch.

Making it easy on the other person will increase your chances of your patch being accepted, so keep a clean master as a common reference point and make changes in branches off of the master. Keep your branches narrow in focus: rather than piling up eleventy-three new features in a single branch, keep them separate where you can do so cleanly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!