Skip to content

Instantly share code, notes, and snippets.

@InsulaVentus
Last active October 24, 2017 19:55
Show Gist options
  • Save InsulaVentus/9f204d982482c0ab0f72afa1041be350 to your computer and use it in GitHub Desktop.
Save InsulaVentus/9f204d982482c0ab0f72afa1041be350 to your computer and use it in GitHub Desktop.

Run web-platform tests

$ ./mach wpt testing/web-platform/tests/webdriver/tests/cookies --webdriver-arg=-vv

Run .js tests

$ ./mach test testing/marionette/test_cookie.js

Amend the HEAD commit

  1. Make code changes and stage them (git add <files>)

  2. Run:

$ git commit --amend
  1. The previous step will open up the commit message in git's configured text editor. If you want - make changes to the commit message - then save and close the editor.

  2. To verify that everything looks fine, run:

$ git show HEAD

This will show the diff of the commit you just amended and should now include the changes you staged in (1)

  1. You're done!

Amend a commit behind HEAD

  1. Run:
$ git rebase --interactive HEAD~X

Where X is the number of commits from HEAD where the commit you wish to amend is.

  1. Git will now open its configured text editor and list all the commits from HEAD to your commit. Change pick to edit for the commit you want to edit. Save and close the editor.

  2. Make your changes.

  3. Commit your changes:

$ git commit --all --amend --no-edit

Where --all stages unstaged changes, --amend edits the commit and --no-edit leaves the commit message unchanged.

  1. Complete the rebase:
$ git rebase --continue
  1. You're done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment