git clone branche
git pull branche
git init
Un nouveau répertoire .git doit apparaître
git config --global user.email "adresse@mail.fr" git config --global user.name "username"
git remote add origin <URL>
Procédure simple pour pousser du code sur un dépôt avec Git :
git branch -M main
git add .
git commit -m "description"
git push origin main
git status
git rm fichier
git mv fichier nouveaunom
git branch -c nouvellebranche
git checkout nouvellebranche
git push origin nouvellebranche
git log
git show 674906a6f96c2d3f004525cd80ae1cb29c0c21cc
git diff
Ajouter
–cached après un git add pour afficher les modifications non poussées
git diff b721da7..eb01911
git checkout fichier
git restore --staged
git revert <commit ID>
git reset <commit ID>