tech:notes_git
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tech:notes_git [2025/09/10 10:45] – Jean-Baptiste | tech:notes_git [2026/03/11 18:30] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 22: | Ligne 22: | ||
| Voir : | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| * https:// | * https:// | ||
| * [[https:// | * [[https:// | ||
| Ligne 99: | Ligne 101: | ||
| git push -f | git push -f | ||
| </ | </ | ||
| + | |||
| === check before git push | === check before git push | ||
| Ligne 119: | Ligne 122: | ||
| To see full file paths of the files that will change, run: | To see full file paths of the files that will change, run: | ||
| <code bash> | <code bash> | ||
| + | git diff --name-only [remote repo/ | ||
| + | |||
| + | # Ou encore | ||
| + | git diff --name-status [remote repo/ | ||
| git diff --numstat [remote repo/ | git diff --numstat [remote repo/ | ||
| </ | </ | ||
| Ligne 133: | Ligne 140: | ||
| == Configurer son environnement | == Configurer son environnement | ||
| - | <code bash ~/ | + | '' |
| + | <code bash> | ||
| export PS1=' | export PS1=' | ||
| export GIT_PS1_SHOWDIRTYSTATE=1 GIT_PS1_SHOWSTASHSTATE=1 GIT_PS1_SHOWUNTRACKEDFILES=1 | export GIT_PS1_SHOWDIRTYSTATE=1 GIT_PS1_SHOWSTASHSTATE=1 GIT_PS1_SHOWUNTRACKEDFILES=1 | ||
| Ligne 154: | Ligne 162: | ||
| git push -u origin master | git push -u origin master | ||
| </ | </ | ||
| + | |||
| == Push an existing repository from the command line | == Push an existing repository from the command line | ||
| Ligne 405: | Ligne 414: | ||
| </ | </ | ||
| + | |||
| + | # # Checkout the stable branch and find just the latest tag | ||
| + | # git checkout master | ||
| + | # git describe --abbrev=0 --tags | ||
| + | # git tag --sort | ||
| Ligne 449: | Ligne 463: | ||
| <code bash> | <code bash> | ||
| git diff origin/ | git diff origin/ | ||
| + | </ | ||
| + | |||
| + | Diff entre branches | ||
| + | <code bash> | ||
| + | git diff --name-only dev1..dev2 | ||
| + | git difftool -y -t vimdiff dev1 dev2 .gitlab-ci.yml | ||
| </ | </ | ||
| Ligne 486: | Ligne 506: | ||
| git merge master | git merge master | ||
| </ | </ | ||
| + | |||
| === submodule | === submodule | ||
| Voir | Voir | ||
| - | https:// | + | * https:// |
| - | [[https:// | + | * https:// |
| + | * [[https:// | ||
| <code bash> | <code bash> | ||
| Ligne 526: | Ligne 548: | ||
| Avec Gitlab CI | Avec Gitlab CI | ||
| Voir : https:// | Voir : https:// | ||
| - | <code yaml .gitlab-ci.yml> | + | |
| + | '' | ||
| + | <code yaml> | ||
| variables: | variables: | ||
| GIT_SUBMODULE_STRATEGY: | GIT_SUBMODULE_STRATEGY: | ||
| </ | </ | ||
| + | |||
| + | |||
| + | == Diagnostique | ||
| + | |||
| + | <code bash> | ||
| + | export GIT_TRACE=2 | ||
| + | export GIT_CURL_VERBOSE=2 | ||
| + | export GIT_TRACE_PERFORMANCE=2 | ||
| + | export GIT_TRACE_PACK_ACCESS=2 | ||
| + | export GIT_TRACE_PACKET=2 | ||
| + | export GIT_TRACE_PACKFILE=2 | ||
| + | export GIT_TRACE_SETUP=2 | ||
| + | export GIT_TRACE_SHALLOW=2 | ||
| + | </ | ||
| + | |||
| == Autres | == Autres | ||
| Ligne 543: | Ligne 582: | ||
| fetch --unshallow $URL | fetch --unshallow $URL | ||
| </ | </ | ||
| + | |||
| == Python | == Python | ||
| Ligne 549: | Ligne 589: | ||
| * pygit2 | * pygit2 | ||
| - | <code - reuirements.txt> | + | '' |
| + | <code -> | ||
| GitPython | GitPython | ||
| </ | </ | ||
| Ligne 604: | Ligne 645: | ||
| 'git < | 'git < | ||
| </ | </ | ||
| + | |||
| ==== Solution | ==== Solution | ||
| Ligne 610: | Ligne 652: | ||
| git checkout HEAD -- vars/ | git checkout HEAD -- vars/ | ||
| </ | </ | ||
| + | |||
| === Pb git diff et git difftool ne fonctionne pas | === Pb git diff et git difftool ne fonctionne pas | ||
tech/notes_git.1757493946.txt.gz · Dernière modification : de Jean-Baptiste
