Skip to main content

Contribuir a proyectos

Learn how to contribute to a project through forking.

About forking

After using GitHub by yourself for a while, you may find yourself wanting to contribute to someone else’s project. Or maybe you’d like to use someone’s project as the starting point for your own. This process is known as forking.

Creating a "fork" is producing a personal copy of someone else's project. Forks act as a sort of bridge between the original repository and your personal copy. You can submit pull requests to help make other people's projects better by offering your changes up to the original project. Forking is at the core of social coding at GitHub. Para obtener más información, consultaBifurcar un repositorio."

Bifurcar un repositorio

Este tutorial utiliza el proyecto Spoon-Knife, un repositorio de prueba que se hospeda en y te permite probar el flujo de trabajo de la bifurcación y solicitud de cambios.

  1. Navigate to the Spoon-Knife project at
  2. Click Fork. Botón Bifurcar
  3. GitHub will take you to your copy (your fork) of the Spoon-Knife repository.

Cloning a fork

You've successfully forked the Spoon-Knife repository, but so far, it only exists on GitHub. To be able to work on the project, you will need to clone it to your computer.

You can clone your fork with the command line, CLI de GitHub, or GitHub Desktop.

  1. En GitHub, dirígete a tu bifurcación del repositorio Spoon-Knife.

  2. Sobre la lista de archivos, da clic en Código. Botón de "Código"

  3. Para clonar el repositorio utilizando HTTPS, debajo de "Clonar con HTTPS", da clic en . Para clonar el repositorio utilizando una llave SSH, incluyendo un certificado emitido por la autoridad de certificados SSH de tu organización, haz clic en Utilizar SSH y luego en . Para clonar un repositorio utilizando el CLI de GitHub, haz clic en Utilizar el CLI de GitHub y luego en . El icono de portapapeles para copiar la URL para clonar un repositorio

    El icono del portapapeles para copiar la URL para clonar un repositorio con el CLI de GitHub

  4. Abre la TerminalTerminalGit Bash.

  5. Cambia el directorio de trabajo actual a la ubicación en donde quieres clonar el directorio.

  6. Escribe git clone, y luego pega la URL que copiaste antes. Se verá así, con tu nombre de usuario de GitHub en lugar de YOUR-USERNAME:

    $ git clone
  7. Presiona Enter (Intro). Se creará tu clon local.

    $ git clone
    > Cloning into `Spoon-Knife`...
    > remote: Counting objects: 10, done.
    > remote: Compressing objects: 100% (8/8), done.
    > remove: Total 10 (delta 1), reused 10 (delta 1)
    > Unpacking objects: 100% (10/10), done.

Para aprender más sobre el CLI de GitHub, consulta la sección "Acerca del CLI de GitHub".

Para crear un clon de tu bifurcación, utiliza el marcador --clone.

gh repo fork repository --clone=true
  1. En el menú File (Archivo) haz clic en Clone Repository (Clonar repositorio).

    Clonar opción de menú en la aplicación Mac

    Opción Clone menu (Clonar menú) en la app de Windows

  2. Haz clic en la pestaña que corresponde a la ubicación del repositorio que deseas clonar. También puedes hacer clic en URL para introducir manualmente la ubicación del repositorio.

    Pestañas de ubicación en el menú Clone a repository (Clonar un repositorio)

    Pestañas de ubicación en el menú Clone a repository (Clonar un repositorio)

  3. Elige dentro de la lista el repositorio que deseas clonar.

    Clonar una lista de repositorio

    Clonar una lista de repositorio

  4. Haz clic en Elegir... y navega a la ruta local en donde quieres clonar el repositorio.

    El botón Choose (Elegir)

    El botón Choose (Elegir)

  5. Haz clic en Clone.

    El botón Clone (Clonar)

    El botón Clone (Clonar)

Making and pushing changes

Go ahead and make a few changes to the project using your favorite text editor, like Atom. You could, for example, change the text in index.html to add your GitHub username.

When you're ready to submit your changes, stage and commit your changes. git add . tells Git that you want to include all of your changes in the next commit. git commit takes a snapshot of those changes.

git add .
git commit -m "a short description of the change"
git add .
git commit -m "una descripción corta del cambio"

Para obtener más información sobre cómo probar y confirmar los cambios en GitHub Desktop, consulta la sección "Confirmar y revisar los cambios a tu proyecto".

When you stage and commit files, you essentially tell Git, "Okay, take a snapshot of my changes!" You can continue to make more changes, and take more commit snapshots.

Right now, your changes only exist locally. When you're ready to push your changes up to GitHub, push your changes to the remote.

git push
git push

Para obtener más información sobre cómo subir cambios a GitHub Desktop, consulta la sección "Subir cambios a GtiHub".

Making a pull request

At last, you're ready to propose changes into the main project! This is the final step in producing a fork of someone else's project, and arguably the most important. If you've made a change that you feel would benefit the community as a whole, you should definitely consider contributing back.

To do so, head on over to the repository on GitHub where your project lives. For this example, it would be at<your_username>/Spoon-Knife. You'll see a banner indicating that your branch is one commit ahead of octocat:main. Click Contribute and then Open a pull request.

GitHub will bring you to a page that shows the differences between your fork and the octocat/Spoon-Knife repository. Haz clic en Create Pull Request (Crear solicitud de extracción).

GitHub will bring you to a page where you can enter a title and a description of your changes. It's important to provide as much useful information and a rationale for why you're making this pull request in the first place. The project owner needs to be able to determine whether your change is as useful to everyone as you think it is. Finally, click Create pull request.

Managing feedback

Pull Requests are an area for discussion. In this case, the Octocat is very busy, and probably won't merge your changes. For other projects, don't be offended if the project owner rejects your pull request, or asks for more information on why it's been made. It may even be that the project owner chooses not to merge your pull request, and that's totally okay. Your copy will exist in infamy on the Internet. And who knows--maybe someone you've never met will find your changes much more valuable than the original project.

Finding projects

You've successfully forked and contributed back to a repository. ¡Ve y contribuye más! Para obtener más información, consulta la sección "Encontrar formas de contribuir con el código abierto en GitHub".