git:accueil

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
git:accueil [2024/09/30 13:17] – add how to checkout to a branch with a shallow clone phswgit:accueil [2026/01/17 18:37] (Version actuelle) – add how to plot the number of commits per year phsw
Ligne 22: Ligne 22:
   * [[https://blog.gitbutler.com/git-tips-3-really-large-repositories/|Git Tips 3: Really Large Repositories]]   * [[https://blog.gitbutler.com/git-tips-3-really-large-repositories/|Git Tips 3: Really Large Repositories]]
   * [[https://adamj.eu/tech/2024/09/02/git-avoid-reset-hard-use-keep/|Git: avoid reset --hard, use reset --keep instead]]   * [[https://adamj.eu/tech/2024/09/02/git-avoid-reset-hard-use-keep/|Git: avoid reset --hard, use reset --keep instead]]
 +  * [[https://github.com/k88hudson/git-flight-rules|Flight rules for Git]]
 +  * [[https://blog.shevarezo.fr/post/2025/03/12/git-sparse-checkout|Gérer efficacement vos dépôts avec git sparse-checkout]]
 +  * [[https://refactoringenglish.com/chapters/commit-messages/|How to Write Useful Commit Messages]]
 +  * [[https://www.chiark.greenend.org.uk/~sgtatham/quasiblog/git-no-forge/|Git without a forge]]
 +  * [[https://blog.gitbutler.com/how-git-core-devs-configure-git/|How Core Git Developers Configure Git]]
 +  * [[https://maurycyz.com/misc/easy_git/|You already have a git server]]
 +  * [[https://etc.octavore.com/2025/12/archiving-git-branches-as-tags/|Archiving git branches as tags]]
  
  
Ligne 32: Ligne 39:
   * [[https://jvns.ca/blog/2023/09/14/in-a-git-repository--where-do-your-files-live-/|In a git repository, where do your files live?]]   * [[https://jvns.ca/blog/2023/09/14/in-a-git-repository--where-do-your-files-live-/|In a git repository, where do your files live?]]
   * [[https://avestura.dev/blog/creating-a-git-commit-the-hard-way|Creating a Git commit: The Hard Way]]   * [[https://avestura.dev/blog/creating-a-git-commit-the-hard-way|Creating a Git commit: The Hard Way]]
 +  * [[https://blog.brachiosoft.com/en/posts/git/|A Git story: Not so fun this time]]
 +  * [[https://blog.gitbutler.com/20-years-of-git/|20 years of Git. Still weird, still wonderful.]]
  
  
Ligne 224: Ligne 233:
  
  
-==== Faire un rebase avec le premier commit ====+==== Rebase ==== 
 + 
 +  * [[https://www.brethorsting.com/blog/2026/01/git-rebase-for-the-terrified/|Git Rebase for the Terrified]] 
 + 
 + 
 +=== Faire un rebase avec le premier commit ===
  
 [[https://stackoverflow.com/questions/22992543/how-do-i-git-rebase-the-first-commit|Source]] [[https://stackoverflow.com/questions/22992543/how-do-i-git-rebase-the-first-commit|Source]]
Ligne 540: Ligne 554:
 git show branche:fichier > fichier git show branche:fichier > fichier
 git restore -s branche fichier git restore -s branche fichier
 +</code>
 +
 +
 +==== Récupérer un fichier supprimé dans un commit ====
 +
 +[[https://stackoverflow.com/questions/953481/how-do-i-find-and-restore-a-deleted-file-in-a-git-repository|Source]]
 +<code bash>
 +git checkout <deleting_commit>^ -- <file_path>
 </code> </code>
  
Ligne 625: Ligne 647:
  
  
-==== Compter le nombre de commits ====+==== Statistiques ==== 
 + 
 +=== Compter le nombre de commits ===
  
 [[https://stackoverflow.com/a/11657647|Source]] [[https://stackoverflow.com/a/11657647|Source]]
Ligne 636: Ligne 660:
 </code> </code>
  
 +Graphique du nombre de commits par année :
 +<code bash>
 +git log --format=%ad --date=format:%Y | sort -h | uniq -c | gnuplot -p -e "set terminal pngcairo size 800,600 enhanced font 'Segoe UI,10'; set output 'commits-per-years.png'; set yrange [0:]; set title 'Nombre de commits par année'; set style data histogram; set style fill solid border -1; set grid; plot '< cat -' using 1:xtic(2) notitle;"
 +</code>
  
  
Ligne 696: Ligne 724:
  
 <code bash> <code bash>
-GIT_TRACE=true GIT_CURL_VERBOSE=true GIT_SSH_COMMAND="ssh -vvv" git fetch+time GIT_TRACE=true GIT_CURL_VERBOSE=true GIT_SSH_COMMAND="ssh -vvv" GIT_TRACE_PACK_ACCESS=true GIT_TRACE_PACKET=true GIT_TRACE_PACKFILE=true GIT_TRACE_PERFORMANCE=true GIT_TRACE_SETUP=true GIT_TRACE_SHALLOW=true git pull
 </code> </code>
  
  • git/accueil.1727695034.txt.gz
  • Dernière modification : 2024/09/30 13:17
  • de phsw