Skip to main content

Memo Commandes GIT

Gestion contenu

  • Ajouter un fichier ou dossier modifié
# Add a specific file
git add filename
# Add all changed files in current directory
git add .
  • Pour créer un nouveau commit:
# Add commit message directly in commit command
git commit -m "New commit"
# Open editor to write commit message
git commit
  • Pousser les derniers commit et fichiers vers le serveur 
push origin branch_name
# Push to "main" branch
push origin main

Gestions des branches

  • Lister les branches existante du dépôt
git branch
  • Basculer sur une branche existante
git checkout <branch_name>
  • On peut créer une nouvelle branche avec l'option -b
git checkout -b <new_branch>

Liens

https://wiki-tech.io/Cheatsheet/git