tech:notes_git
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| tech:notes_git [2025/03/24 15:06] – créée - modification externe 127.0.0.1 | tech:notes_git [2026/03/11 18:30] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 22: | Ligne 22: | ||
| Voir : | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| * [[https:// | * [[https:// | ||
| * https:// | * https:// | ||
| * Oh My Git! | * Oh My Git! | ||
| + | * http:// | ||
| Git | Git | ||
| Ligne 97: | Ligne 101: | ||
| git push -f | git push -f | ||
| </ | </ | ||
| + | |||
| === check before git push | === check before git push | ||
| Ligne 117: | 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 131: | 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 152: | 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 168: | Ligne 179: | ||
| </ | </ | ||
| - | Ne pas vérifier le certificat HTTPS | + | |
| + | == Git grep | ||
| + | |||
| + | Search the working directory for '' | ||
| <code bash> | <code bash> | ||
| - | git -c http.sslVerify=false pull | + | git grep " |
| - | # ou | + | |
| - | env GIT_SSL_NO_VERIFY=true git pull | + | |
| </ | </ | ||
| + | |||
| == Branches et merge | == Branches et merge | ||
| Ligne 401: | Ligne 414: | ||
| </ | </ | ||
| + | |||
| + | # # Checkout the stable branch and find just the latest tag | ||
| + | # git checkout master | ||
| + | # git describe --abbrev=0 --tags | ||
| + | # git tag --sort | ||
| Ligne 445: | 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 482: | Ligne 506: | ||
| git merge master | git merge master | ||
| </ | </ | ||
| + | |||
| === submodule | === submodule | ||
| Voir | Voir | ||
| - | https:// | + | * https:// |
| - | [[https:// | + | * https:// |
| + | * [[https:// | ||
| <code bash> | <code bash> | ||
| Ligne 522: | 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 539: | Ligne 582: | ||
| fetch --unshallow $URL | fetch --unshallow $URL | ||
| </ | </ | ||
| + | |||
| == Python | == Python | ||
| Ligne 545: | Ligne 589: | ||
| * pygit2 | * pygit2 | ||
| - | <code - reuirements.txt> | + | '' |
| + | <code -> | ||
| GitPython | GitPython | ||
| </ | </ | ||
| Ligne 598: | Ligne 643: | ||
| fatal: ambiguous argument ' | fatal: ambiguous argument ' | ||
| Use ' | Use ' | ||
| - | 'git < | + | 'git < |
| </ | </ | ||
| + | |||
| ==== Solution | ==== Solution | ||
| Ligne 606: | 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.1742825205.txt.gz · Dernière modification : de 127.0.0.1
