info:git:homepage

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
info:git:homepage [2023/11/03 07:51] – [Rollback] radeffinfo:git:homepage [2026/07/28 09:09] (Version actuelle) – [Forcer le push] radeff
Ligne 54: Ligne 54:
  
     git config receive.denyCurrentBranch ignore     git config receive.denyCurrentBranch ignore
 +
 +==== ignorer des fichiers déjà indexés ====
 +exemple: ignorer dans du dev concretecms des fichiers déjà indexés sous app/config/generated_overrides
 +    git rm -r --cached config/generated_overrides
 +
 +L'option --cached est cruciale : elle supprime le fichier de l'index Git mais le laisse physiquement sur votre disque.
 +
 +Validez ce changement pour appliquer la modification :
 +
 +    git commit -m "Stop tracking generated overrides config files"
 +
 +
 ===== Basics ===== ===== Basics =====
 {{:info:git:git-branches.svg|}} {{:info:git:git-branches.svg|}}
Ligne 61: Ligne 73:
 fork then fork then
  
-git remote add origin git@github.com:USER/PROJECT.git+git remote add origin git@gitlab.com:USER/PROJECT.git
  
 <code> <code>
-git pull git@github.com:USER/PROJECT.git+git pull git@gitlab.com:USER/PROJECT.git
 git st git st
 git add... git add...
 hg commit -m "comment" hg commit -m "comment"
-git push git@github.com:USER/PROJECT.git +git push git@gitlab.com:USER/PROJECT.git 
-https://github.com/zpartakov/vamosAcomer+https://gitlab.com/zpartakov/vamosAcomer
 git log git log
 #details d'un commit #details d'un commit
 git show 0943dce3be9c4a0f21c397f62ea18f78a4bcea26 git show 0943dce3be9c4a0f21c397f62ea18f78a4bcea26
 </code> </code>
-===== Rollback ===== +===== Branch ===== 
-Revenir en arrière d'un commit +lister les branches: 
 +    git branch 
 +ensuite changer de branche avec:     
 +    git checkout <existing_branch> 
 +===== Reset (rollback) ===== 
 +<note warning>oups, on a commité trop vite!</note> 
 + 
 +**Revenir en arrière d'un commit**  
     git reset --hard HEAD^     git reset --hard HEAD^
  
Ligne 84: Ligne 104:
  
 doc: https://git-scm.com/docs/git-reset doc: https://git-scm.com/docs/git-reset
 +===== annuler le reset =====
 +on vient de faire le reset //supra// et on se rend compte que c'est une grosse c...!
 +
 +utiliser reflog pour trouver le bon commit:
 +
 +<code bash>
 +radeff@radeff-lenovo:~/recettes git reflog
 +eeb6cd2 (HEAD -> master, origin/master, origin/HEAD) HEAD@{0}: reset: moving to HEAD^
 +c8fd577 HEAD@{1}: commit: minor
 +eeb6cd2 (HEAD -> master, origin/master, origin/HEAD) HEAD@{2}: commit: restaurants
 +dd3b660 HEAD@{3}: clone: from REPOSITORY:~/www/intranet/recettes
 +</code>
 +
 +ici, c'est donc le c8fd577 qu'on va restaurer avec cherry-pick
 +
 +<code bash>
 +radeff@radeff-lenovo:~/recettes git cherry-pick c8fd577
 +[master b95febf] minor
 + Date: Thu Dec 4 06:33:13 2025 +0100
 + 13 files changed, 683 insertions(+), 92 deletions(-)
 + delete mode 100644 bug/restaurants/views/layout/app.php
 +</code>
 +
 +ouf! petite sueur passée...
 +
 +<note important>Le reflog garde l'historique pendant environ 30 jours, donc agissez rapidement !</note>
 ===== cherry-pick (cloner un commit d'une branche à une autre) ===== ===== cherry-pick (cloner un commit d'une branche à une autre) =====
      git cherry-pick db6f662      git cherry-pick db6f662
Ligne 113: Ligne 159:
     git commit -am "My feature is ready"     git commit -am "My feature is ready"
  
-Push your branch to GitLab:+Push your branch to Git:
  
     git push origin $feature_name     git push origin $feature_name
  
-voir https://docs.gitlab.com/ee/gitlab-basics/feature_branch_workflow.html#feature-branch-workflow+doc [[gitlab]]: https://docs.gitlab.com/ee/gitlab-basics/feature_branch_workflow.html#feature-branch-workflow
  
  
 ===== Cloner une branche spécifique ===== ===== Cloner une branche spécifique =====
-   git clone -b my-branch https://git@github.com/username/myproject.git+   git clone -b my-branch https://git@gitlab.com/username/myproject.git
  
 exemple, cloner la branche stable de limesurvey et la mettre à jour exemple, cloner la branche stable de limesurvey et la mettre à jour
  
-   git clone -b 2.06lts git@github.com:LimeSurvey/LimeSurvey.git +   git clone -b 2.06lts git@gitlab.com:LimeSurvey/LimeSurvey.git 
-   git pull git@github.com:LimeSurvey/LimeSurvey.git 2.06lts+   git pull git@gitlab.com:LimeSurvey/LimeSurvey.git 2.06lts
  
 ===== Renommer la branche master de votre dépôt Git en main ===== ===== Renommer la branche master de votre dépôt Git en main =====
Ligne 162: Ligne 208:
  
 https://nouslesdevs.com/cli/securiser-un-git/ https://nouslesdevs.com/cli/securiser-un-git/
-==== clés ssh ==== 
  
-Si vous avez un méchant message lors d'un pull ou d'un push genre: 
-<code> 
-Permission denied (publickey). 
-fatal: Could not read from remote repository. 
- 
-Please make sure you have the correct access rights 
-and the repository exists. 
-</code> 
- 
-Déclarer les clés dans la section //Deploy Keys// pour le dépot: 
- 
-https://gitlab.com/yourName/yourRepo/-/settings/repository 
- 
-Voir l'onglet "Clefs de déploiement à accès privé" 
  
 === How to use "git clone" with a custom SSH key === === How to use "git clone" with a custom SSH key ===
Ligne 188: Ligne 219:
 </code> </code>
  
 +====== Git Cheat Sheets ======
 +
 +https://memcat.eu/2024/memo-git
 ====== Tutoriels ====== ====== Tutoriels ======
  
Ligne 205: Ligne 239:
 ====== git GUI ====== ====== git GUI ======
 des clients graphiques pour git des clients graphiques pour git
 +
 +===== Git Graph =====
 +un plugin bien pratique pour [[info:code:codium|VScodium aka Codium]]
 +
 +https://github.com/mhutchie/vscode-git-graph
 ===== Gitcraken / git GUI ===== ===== Gitcraken / git GUI =====
 //gitcraken//, un client graphique simple à configurer pour voir vos projets git //gitcraken//, un client graphique simple à configurer pour voir vos projets git
Ligne 214: Ligne 253:
 ===== qgit ===== ===== qgit =====
 [[qgit]] version graphique [[qgit]] version graphique
- 
 ====== GitLab ====== ====== GitLab ======
-Version web libre de git avec une vue [[http://linuxfr.org/users/dzecniv/journaux/gitlab-8-11-vue-kanboard-et-bien-plus|kanboard]] +Version web libre de git qui est, lui, dans la prison CroSoft. Je n'en reviens toujours pas du nombre de librisite qui ne sont pas passés de gitHub à gitLab mais c'est comme ça
- +
-https://gitlab.com/+
  
-c'est le plus simple si vous ne voulez pas installer tout le tintouin...+<note tip>[[gitlab]]</note> 
  
-Mon espace gitlab: https://gitlab.com/zpartakov 
-===== Fork ===== 
-https://docs.gitlab.com/ee/user/project/repository/forking_workflow.html 
-===== Merge / Merging request ===== 
-https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html 
-===== Groups ===== 
-https://gitlab.com/groups/new 
- 
-https://gitlab.com/groups/communication-web/-/group_members> 
-===== Todos / Issues ===== 
-Système de ticketing de gitlab 
-  * [[https://www.youtube.com/watch?v=Pa6zUk89kXg|Gitlab - 4. Les tickets / Issues : principes, organisation / tuto vidéo en fr]] 
-Utiliser gitlab comme outil collaboratif de gestion de projet/tâches 
-  * https://docs.gitlab.com/ee/user/todos.html gitlab todos 
-===== Doc ===== 
-  * [[https://docs.gitlab.com/ce/gitlab-basics/README.html|GitLab Flow]] (beginner) - the basics of git and GitLab 
-  * [[https://about.gitlab.com/2015/02/19/8-tips-to-help-you-work-better-with-git/|8 Tips]] (intermediate) - become more efficient with Git 
-  * [[https://docs.gitlab.com/ce/ci/quick_start/README.html|GitLab CI]] (advanced) - quick-start guide to continuous integration 
-  * https://github.com/gitlabhq/gitlabhq 
- 
- 
-===== Local install ===== 
-  * [[https://about.gitlab.com/installation/|GitLab Installation]] 
-  * [[https://about.gitlab.com/downloads/#ubuntu1604|+++install on ubunutu 16.04 (or any OS)]] 
-  * [[https://www.nickyeoman.com/blog/system-administration/180-install-gitlab-on-ubuntu|how to install GitLab (A alternative to GitHub) on Ubuntu Server 14.04 LTS.]] 
-  *  [[https://www.grafikart.fr/tutoriels/divers/gitlab-ci-docker-808|+++grafikart Tutoriel Vidéo: Intégration continue avec GitLab]] 
  
 ====== Github ====== ====== Github ======
- 
 {{:info:git:msevil.png?nolink|}} {{:info:git:msevil.png?nolink|}}
 ===== Github -> gitlab ===== ===== Github -> gitlab =====
Ligne 265: Ligne 274:
  
 Credits: https://stackoverflow.com/questions/7353538/setting-up-a-github-commit-rss-feed#7353586 Credits: https://stackoverflow.com/questions/7353538/setting-up-a-github-commit-rss-feed#7353586
- 
-====== Tips ====== 
-===== gitlab-api ===== 
-  * https://blog.stephane-robert.info/post/gitlab-api/ 
  
  
Ligne 275: Ligne 280:
   * [[:info:docker:]]   * [[:info:docker:]]
  
-{{tag>version, versioning, subversion, mercurial, hg, svn git}}+{{tag>version, versioning, subversion, mercurial, hg, svn, git}}
  
  • info/git/homepage.1698994285.txt.gz
  • Dernière modification : 2023/11/03 07:51
  • de radeff