---
url: 'https://metadrop.net/es/articulos/crear-un-parche-relativo-a-una-carpeta-git-diff-relative'
title: 'Crear un parche relativo a una carpeta "git diff --relative"'
author: 'Agustin Gómez'
date: '2017-01-17T10:22:06+00:00'
updated: '2026-06-10T06:57:45+00:00'
type: article
summary: 'Descubre la principal ventaja y diferencia al generar un parche con git y el parámetro --relative'
tags:
  - Git
published: true
og:
  determiner: Automatic
  site_name: Metadrop
  'image:alt': 'Crear un parche relativo a una carpeta "git diff --relative"'
  street_address: 'Calle Manuel Luna, 12, 3 Dcha'
  locality: Madrid
  region: Madrid
  postal_code: '28020'
  country_name: España
  email: hola@metadrop.net
  phone_number: '910053180'
schema:
  '@context': 'https://schema.org'
  '@graph':
    -
      '@type': Article
      '@id': 'https://metadrop.net/es/articulos/crear-un-parche-relativo-a-una-carpeta-git-diff-relative#article'
      name: 'Crear un parche relativo a una carpeta "git diff --relative"'
      headline: 'Crear un parche relativo a una carpeta "git diff --relative"'
      description: "Descubre la principal ventaja y diferencia al generar un parche con git y\_el parámetro --relative"
      about: Git
      datePublished: '2014-06-25T08:00:00+0200'
      dateModified: '2026-06-10T08:57:45+0200'
      author:
        '@type': Person
        name: 'Agustin Gómez'
      publisher:
        '@type': Organization
        '@id': 'https://metadrop.net/#organization'
      mainEntityOfPage: 'https://metadrop.net/es/articulos/crear-un-parche-relativo-a-una-carpeta-git-diff-relative'
    -
      '@type': Organization
      '@id': 'https://metadrop.net/#organization'
      url: 'https://metadrop.net/'
      name: Metadrop
      sameAs:
        - 'https://www.drupal.org/metadrop'
        - 'https://twitter.com/metadrop'
        - 'https://asociaciondrupal.es/partner/metadrop'
        - 'https://www.linkedin.com/company/metadrop'
      logo:
        '@type': ImageObject
        url: 'https://metadrop.net/themes/custom/mdrop_radix/logo-metadrop-500-500.jpg'
        width: '500'
        height: '500'
    -
      '@type': ItemPage
      '@id': 'https://metadrop.net/es/articulos/crear-un-parche-relativo-a-una-carpeta-git-diff-relative'
      breadcrumb:
        '@type': BreadcrumbList
        itemListElement:
          -
            '@type': ListItem
            position: 1
            name: Inicio
            item: 'https://metadrop.net/es'
          -
            '@type': ListItem
            position: 2
            name: 'Artículos expertos sobre Drupal y tecnología'
            item: 'https://metadrop.net/es/articulos'
      publisher:
        '@type': Organization
        '@id': 'https://metadrop.net/#organization'
---
 1. [Artículos](https://metadrop.net/es/articulos)
 
  

# Crear un parche relativo a una carpeta "git diff --relative"

Miércoles 25 de Junio de 2014

 

 



Descubre la principal ventaja y diferencia al generar un parche con git y el parámetro --relative



   



En algunos casos necesitamos crear un parche relativo a una carpeta. Por ejemplo, estamos trabajando en una distribución, y queremos que el parche sea relativo a un módulo que está metido dentro del profile.

Como ejemplo usamos la distribución de commons y queremos crear un parche con los cambios creados en el módulo commons\_media de la distribución. Vamos a la carpeta de commons\_media y usamos --relative al hacer el git diff:

```bash
cd commons/profiles/commons/modules/commons/commons_media
```

```bash
git diff --relative > changes2.patch
```

Las diferencias serían las siguientes

Usando git diff para parchear un archivo dentro del commons\_media:

```bash
diff --git
```

```plaintext
a/profiles/commons/modules/commons/commons_media/commons_media.features.field_instance.inc
b/profiles/commons/modules/commons/commons_media/commons_media.features.field_instance.inc
/* Codigo del parche aquí debajo */
```

Usando:

```bash
git diff --relative
```

```bash
diff --git
```

```plaintext
a/commons_media.features.field_instance.inc
b/commons_media.features.field_instance.inc 
/* Codigo del parche aquí debajo */
```



[Git](https://metadrop.net/es/articulos?text=Git)