1 - Récapitulatif Git


Développement d'applications mobiles

Récapitulatif Git

Récapitulatif Git


Architecture distribuée Client-Serveur

Serveur


Commandes de base

Commandes de base

  • git clone URL
  • git status
  • git add FICHIER FICHIER2 GLOB
  • git add -A
  • git commit -m 'MESSAGE'
  • git pull
    • Si conflit, résoudre le conflit puis add et commit les fichiers
  • git push
  • Guide Git

Manipuler les branches

Manipuler les branches

  • git branch --all
  • git checkout BRANCHE-LOCALE
  • git checkout -b NOUVELLE-BRANCHE-LOCALE
    • git push --set-upstream origin NOUVELLE-BRANCHE-LOCALE
  • git fetch && git checkout BRANCHE-REMOTE
  • git merge BRANCHE-LOCALE-A-MERGE
    • va inclure BRANCHE-A-MERGE dans la branche actuelle
  • git fetch REMOTE-A-MERGE && git merge REMOTE-A-MERGE
  • Tutoriel Learn Git Branching
  • Cheatsheet Git branches

Conseils

Conseils

  • Commits fréquents, petite unité fonctionnelle
    • Ne PAS commit du code non-fonctionnel
  • Pull régulièrement
  • Push régulièrement
  • Gérer les conflits localement: Commit, Pull, Push
  • N'hésitez pas à utiliser les branches (surtout en travail collaboratif): feature-x, test-y
  • Exploitez le mécanisme de .gitignore
  • Git Tower - Best practices

Bitbucket

Bitbucket

git config --global user.name "John Doe"
git config --global user.email "1234567@cshawi.ca"