WhatsApp: +39 339 289 627 8
E-mail: info@creazione-siti-web.eu

 

Tutto il neccessario su git in un unico articolo

 

I comandi di log:

git status //serve per vedere lo sato di stage, cioè quali i file sono stegiate o da mettere in stage git log //serve per vedere la lista di tutti i commit fatti

Per aggingere tutti i file nello stage:

git add . //qui il punto dice aggingimi tutti i file che hanno subito la modifica in stage

Per fare il commit:

git commit -m "Messaggio di commit"

Per resettare i file messi in stage, cioè togliere i file dallo stage

git reset

Per resettare l'ultimo commit e mantenere le ultime modifiche nello stage:

git reset --soft HEAD~1

Per resettare l'ultimo commit e cancellare le ultime modifiche:

git reset --hard HEAD~1

Fare rollback ai file modificati (non sono ancora staged (staggiate)):

git restore . //dove il punto dice riprestinami tutti i file modificati

Per creare un nuovo branch:

git branch nome_del_branch

Per spostarsi su branch:

git checkout nome_del_branch

Per mergiare un branch a un altro branch, per esempio mergiare un branch a branch master, ricordati di spostarsi su branch master, cioè bisogna sempre spostarsi su branch a quale si vuole fare merge:

git merge nome_del_branch_da_mergiare_a _quello_dove_siamo