diff --git a/crates/gitbutler-core/src/fs.rs b/crates/gitbutler-core/src/fs.rs
index 43a7d626b..89c82b865 100644
--- a/crates/gitbutler-core/src/fs.rs
+++ b/crates/gitbutler-core/src/fs.rs
@@ -58,13 +58,21 @@ pub(crate) fn write<P: AsRef<Path>>(
     file_path: P,
     contents: impl AsRef<[u8]>,
 ) -> anyhow::Result<()> {
-    let mut temp_file = gix::tempfile::new(
-        file_path.as_ref().parent().unwrap(),
-        ContainingDirectory::Exists,
-        AutoRemove::Tempfile,
-    )?;
-    temp_file.write_all(contents.as_ref())?;
-    Ok(persist_tempfile(temp_file, file_path)?)
+    #[cfg(windows)]
+    {
+        Ok(std::fs::write(file_path, contents)?)
+    }
+
+    #[cfg(not(windows))]
+    {
+        let mut temp_file = gix::tempfile::new(
+            file_path.as_ref().parent().unwrap(),
+            ContainingDirectory::Exists,
+            AutoRemove::Tempfile,
+        )?;
+        temp_file.write_all(contents.as_ref())?;
+        Ok(persist_tempfile(temp_file, file_path)?)
+    }
 }
 
 /// Write a single file so that the write either fully succeeds, or fully fails,
@@ -73,13 +81,25 @@ pub(crate) fn create_dirs_then_write<P: AsRef<Path>>(
     file_path: P,
     contents: impl AsRef<[u8]>,
 ) -> std::io::Result<()> {
-    let mut temp_file = gix::tempfile::new(
-        file_path.as_ref().parent().unwrap(),
-        ContainingDirectory::CreateAllRaceProof(Retries::default()),
-        AutoRemove::Tempfile,
-    )?;
-    temp_file.write_all(contents.as_ref())?;
-    persist_tempfile(temp_file, file_path)
+    #[cfg(windows)]
+    {
+        let dir = file_path.as_ref().parent().unwrap();
+        if !dir.exists() {
+            std::fs::create_dir_all(dir)?;
+        }
+        std::fs::write(file_path, contents)
+    }
+
+    #[cfg(not(windows))]
+    {
+        let mut temp_file = gix::tempfile::new(
+            file_path.as_ref().parent().unwrap(),
+            ContainingDirectory::CreateAllRaceProof(Retries::default()),
+            AutoRemove::Tempfile,
+        )?;
+        temp_file.write_all(contents.as_ref())?;
+        persist_tempfile(temp_file, file_path)
+    }
 }
 
 fn persist_tempfile(