divers:github
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| divers:github [2024/08/31 19:31] – créée root | divers:github [2025/03/25 08:07] (Version actuelle) – root | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | git init | + | ===== Ajouter à un nouveau repository ===== |
| + | <code bash>git init | ||
| git config --global init.defaultBranch main | git config --global init.defaultBranch main | ||
| #git branch -M main | #git branch -M main | ||
| Ligne 6: | Ligne 7: | ||
| git commit -am " | git commit -am " | ||
| git push origin main | git push origin main | ||
| + | </ | ||
| + | Version alternative: | ||
| + | <code bash> | ||
| + | git remote add origin git@github.com: | ||
| + | git add . | ||
| + | git commit -m " | ||
| + | git push -u origin main | ||
| + | git pull origin main | ||
| + | </ | ||
| + | ===== Cloner une branche en particulier ===== | ||
| + | <code bash>git clone -b uat git@github.com: | ||
| + | |||
| + | ===== Pousser des branches vers des autres ===== | ||
| + | Exemple: migrer la branche vincent vers uat | ||
| + | <code bash>git push origin vincent: | ||
| + | |||
| + | autre cas on souhaiter remettre à jour la branche vincent avec le code d'uat en cours: | ||
| + | <code bash> | ||
| + | git checkout vincent | ||
| + | git merge uat </ | ||
divers/github.1725132668.txt.gz · Dernière modification : de root
