Submitting a pull request with a signed commit

We can now finalize and activate our gpg signing. In the console, type in the following command:

git config --global commit.gpgsign true

Now, instead of having to create a separate branch and go through the same steps all over again, we will simply amend our commit and add our signature to it:

git commit --amend -S -m "Testing commit signing."
You may get the following error when trying to amend your commit:
error: gpg failed to sign the data
fatal: failed to write commit object
If you do, you may need to set the following environment variable:
export GPG_TTY=$(tty)

The command will delegate the signing to GPG, and you should be asked for your gpg passphrase. Once this is completed, we can push our changes to our test branch using the following command:

git push origin test --force

We need to --force our change as we are only amending our commit. 

If you go back to the browser and look at the pull request, you should now have something like the following:

We should have solved one problem—the signing of commits. If you have the same results, you now know everything is configured properly. You can go ahead and focus on correcting the test coverage by adding a test for our new transaction.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.15.161