Skip to content

Instantly share code, notes, and snippets.

@tkuhrt
Last active December 10, 2020 16:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkuhrt/2cb6ae09fa6c122674766d2bb9239cdb to your computer and use it in GitHub Desktop.
Save tkuhrt/2cb6ae09fa6c122674766d2bb9239cdb to your computer and use it in GitHub Desktop.
Steps to contribute a new lab proposal to Hyperledger Labs

Steps to Contribute a New Hyperledger Labs Proposal

  1. Browse to https://github.com/hyperledger-labs/hyperledger-labs.github.io

  2. Click the fork button

  3. Clone the repository to your machine using: git clone https://github.com/username/hyperledger-labs.github.io, replacing username with your Github username.

  4. Change to the hyperledger-labs.github.io directory

  5. Verify that git is configured properly. Specifically, make sure that your name and email in your local machine settings match the name and email associated with your Github profile.

    git config user.email
    git config user.name
    

    If the values do not match your Github profile, you can set them with the following, replacing email@example.com and Mona Lisa with the values that match your Github profile. NOTE: This will only change the configuration for the hyperledger-labs.github.io repository. If you want to change it for all repositories, use git config --global instead.

    git config user.email "email@example.com"
    git config user.name "Mona Lisa"
    
  6. Create a branch for you work using git checkout -b branch-name, replacing branch-name with a name to reflect the lab that you are proposing. For example, if you are adding a lab named foo, you might name your branch lab_foo.

  7. Copy the proposal-template.md to the labs directory under a name matching the lab. Let's continue with the idea that you are creating a lab named foo. This is the command that you would use: cp proposal-template.md labs/foo.md

  8. Edit the newly created file in your favorite editor filling out the information that is requested in the template.

  9. Once you have fully completed the newly created lab proposal, then commit the source code using the following.

    IT IS IMPORTANT TO INCLUDE THE -s OPTION TO SIGN YOUR COMMIT.

    git add .
    git commit -s -m "Adding new lab <lab-name>"
    

    NOTE: Replace <lab-name> with the name of your new lab.

  10. Optional: If you performed multiple commits on your local branch, you can squash these commits using git rebase -i HEAD~<# of commits>. For example, to squash four commits into one, do the following:

    git rebase -i HEAD~4
    

    In the text editor that comes up, keep the word pick for the first commit and replace the words pick with squash next to all other commits. Save and close the editor, and git will combine the "squash"'ed commits with the one before it. Git will then give you the opportunity to change your commit message to something like, "Issue #100: Fixed retweet bug." Make sure that your commit message also contains the DCO sign-off line.

    Important: If you've already pushed commits to GitHub, and then squash them locally, you will have to force the push to your branch.

    git push origin branch-name --force
    

    Helpful hint: Before doing a push, you can always edit your last commit message, before pushing, by using:

    git commit --amend -s
    

    The -s option will add the necessary line for the DCO sign-off.

  11. Push your changes, replacing branch-name with the branch name that you created above.

    git push origin branch-name
    
  12. Create a new pull request by visiting https://github.com/username/hyperledger-labs.github.io, replacing username with your Github username. Click the "New Pull Request" button.

  13. Verify that the pull request contains your commits and that all commits are signed off prior to creating the pull request. If all commits are not signed off, the lab will be rejected. Please revisit steps 9-11 if you have any commits that are not signed off.

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment