How to properly perform a patch so that the correct directory is used? I attempted to make a patch using Making a Drupal patch with Git and ran into one issue after creating the patch. For some reason, I cannot get the proper location to be stored in the patch. 

How can I get the desired results in the patch?

Issue 


the issue is that it is setting diff --git "a/docroot/modules/contrib/video_embed_vidyard/src..."


Command used to generate the patch:

git diff &lt;commit#1&gt; &lt;commit#2&gt; &gt; patch-name.patch


Current results:

diff --git a/docroot/modules/contrib/video_embed_vidyard/src/Plugin/video_embed_field/Provider/Vidyard.php b/docroot/modules/contrib/video_embed_vidyard/src/Plugin/video_embed_field/Provider/Vidyard.php
index 94a7dc26b..4de97deb7 100644
--- a/docroot/modules/contrib/video_embed_vidyard/src/Plugin/video_embed_field/Provider/Vidyard.php
+++ b/docroot/modules/contrib/video_embed_vidyard/src/Plugin/video_embed_field/Provider/Vidyard.php


Desired results:

diff --git a/src/Plugin/video_embed_field/Provider/Vidyard.php 
b/src/Plugin/video_embed_field/Provider/Vidyard.php
index 94a7dc2..be635ad 100644
--- a/src/Plugin/video_embed_field/Provider/Vidyard.php
+++ b/src/Plugin/video_embed_field/Provider/Vidyard.php



I want to be able to generate a/src/.. instead of a/docroot/modules/contrib/video_embed_vidyard/src
Actually, there is a fairly easy way to generate a patch for a certain path with --relative.

So in your case, just run git diff --relative=docroot/modules/contrib/video_embed_vidyard.