Skip to main content

If you edit a Drupal contrib module, the next time the module is updated those edits will be wiped.  So they are not lost there are a couple of options for you to consider:

  • Are the edits worth the contributing to the community?  Yes, you can fork the repo and add the changes for the developer(s) to review; or
  • Create a patch file

 

Creating a patch file

The process:

Add the files you want to see in the diff.  Remembering to only add untracked files.

git stash && git add . && git stash pop 

Now diff the staged:

git diff --staged

Reset the staged files if needed

git reset

Can you run all of the steps in one chained command?

git stash && git add . && git stash pop && git diff --staged && git reset 

 

Related articles