practica2git
Passos per crear un conflicte
- Crear o clonar repositori local
- Crear un arxiu pex. index.html (branca master)
- git add index.html - Afegir-lo al repositori (branca master)
- git commit -m 'Primer commit'
- git branch hotfix1 - Cream nova branca
- git branch hotfix2 - Cream nova branca
- git checkout hotfix1 - Canviam de branca (branca hotfix1)
- Afegim una linea a l'arxiu index.html
- git add index.html - Afegiam arxiu a branca (branca hotfix1)
- git commit -m 'index modificat' (branca hotfix1)
- git checkout master - Canviam a branca (branca master)
- git merge hotfix1 - Ajuntam la branca hotfix1 a la banca master (branca master)
- git checkout hotfix2 - Canviam a branca (branca hotfix2)
- Afegim una linea a arxiu index.html
- git add index.html - Afegim a index.html a la branca (branca hotfix2)
- git commit -m 'index modificat' (branca hotfix2)
- git checkout master - Canviam de branca (branca master)
- git merge hotfix2 - Aquí es crea el CONFLICTE si es fa amb un entorn gràfic es podrà ajuntar els 2 arxius <----------