Crear un conflicto
Cuando surja un conflicto, tendrá que resolverlo para completar su trabajo. En este paso, vamos a crear deliberadamente un conflicto utilizando nuestros dos repositorios existentes, “tutorial” y “tutorial2”.
En primer lugar, abra el archivo sample.txt
del directorio tutorial
. Añada el texto en negrita al archivo y confírmelo.
Anyone can learn Git with this tutorial and Backlog
add: Register a change in an index
commit: Save the status of an index
![Record the status of commit index](/static/4e9a8f49ec25d1845324f70ea1eab76b/5a190/01.png)
Después, abra el archivo sample.txt
del directorio tutorial2
. Añada el texto en negrita al archivo y confírmelo.
Anyone can learn Git with this tutorial and Backlog
add: Register a change in an index
pull: Obtain the content of the remote repository
![pull Acquire the contents of a remote repository.](/static/872e42c66e37b3235eba483a2d018be7/5a190/02.png)
Ahora suba el cambio de tutorial2
al repositorio remoto.
![Push to the remote repository](/static/16e668f363254db234adcd68f556befa/5a190/03.png)
En nuestro repositorio remoto actual, el archivo sample.txt
contiene la tercera línea pull: Obtain the content of the remote repository
y se ha consignado en el registro del historial.
A continuación, vamos a enviar el commit de nuestro repositorio tutorial
al repositorio remoto.
![Git raises a conflict and rejects your push](/static/aad1db1136d67488d3905f317fd9b91f/5a190/04.png)
Como puede ver, Git plantea un conflicto y rechaza su push.