diff --git a/meta/classes-recipe/cargo_common.bbclass b/meta/classes-recipe/cargo_common.bbclass
index 82ab25b59c..358c7d7ed2 100644
--- a/meta/classes-recipe/cargo_common.bbclass
+++ b/meta/classes-recipe/cargo_common.bbclass
@@ -33,6 +33,13 @@ CARGO_DISABLE_BITBAKE_VENDORING ?= "0"
 # Used by libstd-rs to point to the vendor dir included in rustc src
 CARGO_VENDORING_DIRECTORY ?= "${CARGO_HOME}/bitbake"
 
+# Contains a list of crate that are fetch on a git
+# repository instead of from crates.io
+# This is useful when devtool'ing a rust recipe
+# and still patch the path of these dependencies
+# to get these dependencies locally
+CARGO_GIT_DEPENDENCIES ?= ""
+
 CARGO_RUST_TARGET_CCLD ?= "${RUST_TARGET_CCLD}"
 cargo_common_do_configure () {
 	mkdir -p ${CARGO_HOME}/bitbake
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index 26c5803ee6..b8ffeb8614 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -65,6 +65,7 @@ python () {
 
         local_srcuri = []
         fetch = bb.fetch2.Fetch((d.getVar('SRC_URI') or '').split(), d)
+        cargo_git_deps = (d.getVar('CARGO_GIT_DEPENDENCIES') or '').split()
         for url in fetch.urls:
             url_data = fetch.ud[url]
             parm = url_data.parm
@@ -72,6 +73,8 @@ python () {
                     url_data.type == 'npmsw' or url_data.type == 'crate' or
                     'type' in parm and parm['type'] == 'kmeta'):
                 local_srcuri.append(url)
+            if url in cargo_git_deps:
+                local_srcuri.append(url)
 
         d.setVar('SRC_URI', ' '.join(local_srcuri))
 
diff --git a/meta/recipes-extended/rust-example/zvariant-crates.inc b/meta/recipes-extended/rust-example/zvariant-crates.inc
index 297a784661..074ac1934e 100644
--- a/meta/recipes-extended/rust-example/zvariant-crates.inc
+++ b/meta/recipes-extended/rust-example/zvariant-crates.inc
@@ -125,11 +125,16 @@ SRC_URI += " \
     crate://crates.io/winnow/0.4.0 \
     crate://crates.io/zvariant_derive/3.12.0 \
     crate://crates.io/zvariant_utils/1.0.0 \
+"
+
+CARGO_GIT_DEPENDENCIES = " \
     git://github.com/gtk-rs/glib;protocol=https;nobranch=1;name=glib;destsuffix=glib \
     git://github.com/gtk-rs/sys;protocol=https;nobranch=1;name=glib-sys;destsuffix=glib-sys;subpath=glib-sys \
     git://github.com/gtk-rs/sys;protocol=https;nobranch=1;name=gobject-sys;destsuffix=gobject-sys;subpath=gobject-sys \
 "
 
+SRC_URI += "${CARGO_GIT_DEPENDENCIES}"
+
 SRCREV_FORMAT .= "_glib"
 SRCREV_glib = "c9ee583cea07830c099cdcccd33eda9ef705ea93"
 
