What's the workflow to contribute to an open source project using git pull requests? (eg. via Github)

前端 未结 2 1673
眼角桃花
眼角桃花 2021-01-29 20:45

I have a comprehensive step by step description on how I do this and I wanted to share it here so developers can benefit from it (I\'ll answer my own question).

2条回答
  •  遇见更好的自我
    2021-01-29 21:24

    6a) The topic of the commit and format of the commit message are also critical.

    Commit topic

    The commit topic should cover just one logical change. For example, if you were to describe the changes to someone (for example in a commit message, see below) you should not be able to use the word "and" to describe the topic, ex. not "Fix bug 123 and update config default." These should be two separate commits.

    If you have a bunch of separate issues addressed but uncommitted in your working tree, a great tool is the interactive add. Have your fingers remember this batch of commands, then follow the directions:

    git add -i
    5
    *
    

    You can get fancier with the other options, but that says "show me every change in my working tree and let me pick what to stage."

    Then, as usual:

    git ci
    

    Commit message

    You want to be terse and to the point in the title for people scanning the history, while also providing good details in the body for people in the future (including yourself in six months!) digging in to an issue that involves your change.

    My favorite guide to writing good commit messages is the Erlang/OTP wiki page on good commit messages, and to that I'll add that you can't go wrong with the following format:

    Short (<50 chars) present-tense summary of changes
    
    Previously, . 
    
    This commit .
    

提交回复
热议问题