如何贡献项目 {#如何贡献项目}

  • 在 GitHub 上fork到自己的仓库,如 xxx/prometheus_practice,然后clone到本地,并设置用户信息。

    1. $ git clone git@github.com:xxx/prometheus_practice.git
    2. $ cd prometheus_practice
    3. $ git config user.name "yourname"
    4. $ git config user.email "your email"
  • 修改代码后提交,并推送到自己的仓库。

    1. $ #do some change on the content
    2. $ git commit -m "Fix issue #1: change helo to hello"
    3. $ git push
  • 在 GitHub 网站上提交 pull request。

  • 定期使用项目仓库内容更新自己仓库内容。

    1. $ git remote add upstream https://github.com/songjiayang/prometheus_practice
    2. $ git fetch upstream
    3. $ git checkout master
    4. $ git rebase upstream/master
    5. $ git push -f origin master