j1-template 2023.2.7 → 2023.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (363) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/layouts/content_generator_news_panel_posts.html +2 -1
  3. data/_includes/themes/j1/layouts/content_generator_post.html +2 -2
  4. data/_includes/themes/j1/layouts/layout_metadata_generator.html +41 -38
  5. data/_includes/themes/j1/procedures/blocks/footer/boxes/about_box.proc +1 -1
  6. data/_includes/themes/j1/procedures/blocks/footer/boxes/contacts_box.proc +1 -1
  7. data/_includes/themes/j1/procedures/blocks/footer/boxes/issue.proc +1 -1
  8. data/_includes/themes/j1/procedures/blocks/footer/boxes/links_box.proc +1 -1
  9. data/_includes/themes/j1/procedures/blocks/footer/boxes/news_box.proc +1 -1
  10. data/_includes/themes/j1/procedures/layouts/default_writer.proc +1 -3
  11. data/_includes/themes/j1/procedures/layouts/module_writer.proc +7 -23
  12. data/_includes/themes/j1/procedures/layouts/resource_writer.proc +8 -8
  13. data/_layouts/compress.html +26 -21
  14. data/_layouts/default.html +36 -30
  15. data/assets/data/banner.html +5 -2
  16. data/assets/data/footer.html +15 -3
  17. data/assets/data/masterslider.html +1 -0
  18. data/assets/data/menu.html +4 -4
  19. data/assets/data/panel.html +6 -3
  20. data/assets/data/quicklinks.html +138 -149
  21. data/assets/error_pages/HTTP204.html +3 -3
  22. data/assets/error_pages/HTTP400.html +3 -3
  23. data/assets/error_pages/HTTP401.html +3 -3
  24. data/assets/error_pages/HTTP403.html +3 -3
  25. data/assets/error_pages/HTTP404.html +3 -3
  26. data/assets/error_pages/HTTP444.html +3 -3
  27. data/assets/error_pages/HTTP445.html +3 -3
  28. data/assets/error_pages/HTTP446.html +5 -5
  29. data/assets/error_pages/HTTP447.html +7 -7
  30. data/assets/error_pages/HTTP448.html +7 -7
  31. data/assets/error_pages/HTTP500.html +3 -3
  32. data/assets/error_pages/HTTP501.html +3 -3
  33. data/assets/error_pages/HTTP502.html +3 -3
  34. data/assets/error_pages/HTTP503.html +3 -3
  35. data/assets/themes/j1/adapter/js/advertising.js +109 -116
  36. data/assets/themes/j1/adapter/js/analytics.js +1 -1
  37. data/assets/themes/j1/adapter/js/asciidoctor.js +1 -1
  38. data/assets/themes/j1/adapter/js/attic.js +22 -14
  39. data/assets/themes/j1/adapter/js/bmd.js +1 -1
  40. data/assets/themes/j1/adapter/js/carousel.js +5 -4
  41. data/assets/themes/j1/adapter/js/clipboard.js +1 -1
  42. data/assets/themes/j1/adapter/js/comments.js +5 -5
  43. data/assets/themes/j1/adapter/js/cookieConsent.js +1 -1
  44. data/assets/themes/j1/adapter/js/customFunctions.js +1 -1
  45. data/assets/themes/j1/adapter/js/customModule.js +1 -1
  46. data/assets/themes/j1/adapter/js/dropdowns.js +4 -2
  47. data/assets/themes/j1/adapter/js/fab.js +9 -6
  48. data/assets/themes/j1/adapter/js/framer.js +1 -1
  49. data/assets/themes/j1/adapter/js/iconPicker.js +227 -0
  50. data/assets/themes/j1/adapter/js/j1.js +401 -76
  51. data/assets/themes/j1/adapter/js/justifiedGallery.js +9 -3
  52. data/assets/themes/j1/adapter/js/justifiedGalleryCustomizer.js +2 -2
  53. data/assets/themes/j1/adapter/js/lightbox.js +4 -3
  54. data/assets/themes/j1/adapter/js/logger.js +1 -1
  55. data/assets/themes/j1/adapter/js/lunr.js +1 -1
  56. data/assets/themes/j1/adapter/js/masonry.js +4 -3
  57. data/assets/themes/j1/adapter/js/masterslider.js +30 -57
  58. data/assets/themes/j1/adapter/js/mmenu.js +2 -2
  59. data/assets/themes/j1/adapter/js/navigator.js +7 -5
  60. data/assets/themes/j1/adapter/js/nbinteract.js +9 -9
  61. data/assets/themes/j1/adapter/js/particles.js +2 -2
  62. data/assets/themes/j1/adapter/js/rangeSlider.js +2 -2
  63. data/assets/themes/j1/adapter/js/rouge.js +2 -2
  64. data/assets/themes/j1/adapter/js/rtable.js +1 -1
  65. data/assets/themes/j1/adapter/js/rtextResizer.js +1 -1
  66. data/assets/themes/j1/adapter/js/scroller.js +97 -109
  67. data/assets/themes/j1/adapter/js/slick.js +28 -18
  68. data/assets/themes/j1/adapter/js/themeToggler.js +259 -0
  69. data/assets/themes/j1/adapter/js/themer.js +17 -8
  70. data/assets/themes/j1/adapter/js/toccer.js +9 -6
  71. data/assets/themes/j1/adapter/js/translator.js +4 -2
  72. data/assets/themes/j1/adapter/js/waves.js +6 -4
  73. data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.css +1322 -417
  74. data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.min.css +3 -3
  75. data/assets/themes/j1/core/css/themes/unodark/bootstrap.css +1983 -1266
  76. data/assets/themes/j1/core/css/themes/unodark/bootstrap.min.css +3 -3
  77. data/assets/themes/j1/core/css/themes/unolight/bootstrap.css +10268 -9401
  78. data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +10 -10
  79. data/assets/themes/j1/core/css/vendor.css +0 -14
  80. data/assets/themes/j1/core/css/vendor.min.css +1 -1
  81. data/assets/themes/j1/modules/advertising/js/adInitializer.js +160 -0
  82. data/assets/themes/j1/modules/backstretch/js/backstretch.js +6 -4
  83. data/assets/themes/j1/modules/backstretch/js/backstretch.min.js +1 -1
  84. data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.js +1 -1
  85. data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.min.js +1 -1
  86. data/assets/themes/j1/modules/iconPicker/README.md +266 -0
  87. data/assets/themes/j1/modules/iconPicker/css/universal-icon-picker.css +419 -0
  88. data/assets/themes/j1/modules/iconPicker/css/universal-icon-picker.min.css +17 -0
  89. data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome-brands.json +467 -0
  90. data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome-brands.min.json +1 -0
  91. data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome-regular.json +169 -0
  92. data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome-regular.min.json +1 -0
  93. data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome-solid.json +1136 -0
  94. data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome-solid.min.json +1 -0
  95. data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome.json +1772 -0
  96. data/assets/themes/j1/modules/iconPicker/icons-libraries/font-awesome.min.json +1 -0
  97. data/assets/themes/j1/modules/iconPicker/icons-libraries/mdi-icons-light.json +292 -0
  98. data/assets/themes/j1/modules/iconPicker/icons-libraries/mdi-icons-light.min.json +1 -0
  99. data/assets/themes/j1/modules/iconPicker/icons-libraries/mdi-icons-regular.json +7312 -0
  100. data/assets/themes/j1/modules/iconPicker/icons-libraries/mdi-icons-regular.min.json +1 -0
  101. data/assets/themes/j1/modules/iconPicker/images/magnifying-glass-solid.svg +1 -0
  102. data/assets/themes/j1/modules/iconPicker/images/star-of-life-solid.svg +3 -0
  103. data/assets/themes/j1/modules/iconPicker/images/xmark-solid.svg +3 -0
  104. data/assets/themes/j1/modules/iconPicker/js/universal-icon-picker.js +493 -0
  105. data/assets/themes/j1/modules/iconPicker/js/universal-icon-picker.min.js +17 -0
  106. data/assets/themes/j1/modules/jquery/AUTHORS.txt +372 -0
  107. data/assets/themes/j1/modules/jquery/LICENSE.txt +43 -0
  108. data/assets/themes/j1/modules/jquery/css/images/ui-icons_444444_256x240.png +0 -0
  109. data/assets/themes/j1/modules/jquery/css/images/ui-icons_555555_256x240.png +0 -0
  110. data/assets/themes/j1/modules/jquery/css/images/ui-icons_777620_256x240.png +0 -0
  111. data/assets/themes/j1/modules/jquery/css/images/ui-icons_777777_256x240.png +0 -0
  112. data/assets/themes/j1/modules/jquery/css/images/ui-icons_cc0000_256x240.png +0 -0
  113. data/assets/themes/j1/modules/jquery/css/images/ui-icons_ffffff_256x240.png +0 -0
  114. data/assets/themes/j1/modules/jquery/css/jquery-ui/jquery-ui.css +92 -92
  115. data/assets/themes/j1/modules/jquery/css/jquery-ui/jquery-ui.min.css +4 -4
  116. data/assets/themes/j1/modules/jquery/css/jquery-ui/jquery-ui.structure.css +88 -88
  117. data/assets/themes/j1/modules/jquery/css/jquery-ui/jquery-ui.structure.min.css +2 -2
  118. data/assets/themes/j1/modules/jquery/css/jquery-ui/jquery-ui.theme.css +4 -4
  119. data/assets/themes/j1/modules/jquery/css/jquery-ui/jquery-ui.theme.min.css +2 -2
  120. data/assets/themes/j1/modules/jquery/js/jquery-ui.js +13683 -13678
  121. data/assets/themes/j1/modules/jquery/js/jquery-ui.min.js +3 -3
  122. data/assets/themes/j1/modules/jquery/js/jquery.js +1029 -1203
  123. data/assets/themes/j1/modules/jquery/js/jquery.min.js +2 -2
  124. data/assets/themes/j1/modules/jquery/js/jquery.min.map +1 -1
  125. data/assets/themes/j1/modules/jquery-3.5.1/css/jquery-ui/jquery-ui.css +1315 -0
  126. data/assets/themes/j1/modules/jquery-3.5.1/css/jquery-ui/jquery-ui.min.css +7 -0
  127. data/assets/themes/j1/modules/jquery-3.5.1/css/jquery-ui/jquery-ui.structure.css +886 -0
  128. data/assets/themes/j1/modules/jquery-3.5.1/css/jquery-ui/jquery-ui.structure.min.css +5 -0
  129. data/assets/themes/j1/modules/jquery-3.5.1/css/jquery-ui/jquery-ui.theme.css +446 -0
  130. data/assets/themes/j1/modules/jquery-3.5.1/css/jquery-ui/jquery-ui.theme.min.css +5 -0
  131. data/assets/themes/j1/modules/jquery-3.5.1/js/extensions/hasClass.js +37 -0
  132. data/assets/themes/j1/modules/jquery-3.5.1/js/extensions/hasClass.min.js +17 -0
  133. data/assets/themes/j1/modules/jquery-3.5.1/js/extensions/removeClass.js +42 -0
  134. data/assets/themes/j1/modules/jquery-3.5.1/js/extensions/removeClass.min.js +17 -0
  135. data/assets/themes/j1/modules/jquery-3.5.1/js/jquery-ui.js +19057 -0
  136. data/assets/themes/j1/modules/jquery-3.5.1/js/jquery-ui.min.js +6 -0
  137. data/assets/themes/j1/modules/jquery-3.5.1/js/jquery.js +10872 -0
  138. data/assets/themes/j1/modules/jquery-3.5.1/js/jquery.min.js +2 -0
  139. data/assets/themes/j1/modules/jquery-3.5.1/js/jquery.min.map +1 -0
  140. data/assets/themes/j1/modules/jquery-3.5.1/js/require.js +2145 -0
  141. data/assets/themes/j1/modules/jquery-3.5.1/js/require.min.js +5 -0
  142. data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-video.js +2 -2
  143. data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-video.min.js +1 -1
  144. data/assets/themes/j1/modules/masterslider/css/theme/uno.css +9 -9
  145. data/assets/themes/j1/modules/masterslider/css/theme/uno.min.css +1 -1
  146. data/assets/themes/j1/modules/mmenuLight/css/theme/uno/mmenu.css +2 -2
  147. data/assets/themes/j1/modules/mmenuLight/css/theme/uno/mmenu.min.css +1 -1
  148. data/assets/themes/j1/modules/rouge/css/uno.dark/theme.css +136 -47
  149. data/assets/themes/j1/modules/rouge/css/uno.light/theme.css +9 -9
  150. data/assets/themes/j1/modules/scroller/js/scroller.js +76 -69
  151. data/assets/themes/j1/modules/scroller/js/scroller.min.js +1 -1
  152. data/assets/themes/j1/modules/translator/js/translator.js +1 -1
  153. data/assets/themes/j1/modules/translator/js/translator.min.js +1 -1
  154. data/lib/j1/version.rb +1 -1
  155. data/lib/starter_web/Gemfile +2 -2
  156. data/lib/starter_web/README.md +5 -5
  157. data/lib/starter_web/_config.yml +4 -1
  158. data/lib/starter_web/_data/blocks/banner.yml +8 -5
  159. data/lib/starter_web/_data/blocks/defaults/footer.yml +3 -3
  160. data/lib/starter_web/_data/blocks/footer.yml +9 -5
  161. data/lib/starter_web/_data/blocks/panel.yml +41 -38
  162. data/lib/starter_web/_data/j1_config.yml +68 -58
  163. data/lib/starter_web/_data/layouts/collection.yml +1 -0
  164. data/lib/starter_web/_data/layouts/default.yml +1 -1
  165. data/lib/starter_web/_data/layouts/home.yml +9 -9
  166. data/lib/starter_web/_data/layouts/news_panel_posts.yml +1 -0
  167. data/lib/starter_web/_data/layouts/page.yml +2 -1
  168. data/lib/starter_web/_data/layouts/post.yml +1 -0
  169. data/lib/starter_web/_data/layouts/raw.yml +1 -0
  170. data/lib/starter_web/_data/modules/advertising.yml +134 -61
  171. data/lib/starter_web/_data/modules/analytics.yml +2 -2
  172. data/lib/starter_web/_data/modules/attics.yml +4 -7
  173. data/lib/starter_web/_data/modules/defaults/advertising.yml +2 -1
  174. data/lib/starter_web/_data/modules/defaults/attics.yml +3 -3
  175. data/lib/starter_web/_data/modules/defaults/iconPicker.yml +42 -0
  176. data/lib/starter_web/_data/modules/defaults/navigator.yml +15 -13
  177. data/lib/starter_web/_data/modules/defaults/theme_toggler.yml +42 -0
  178. data/lib/starter_web/_data/modules/iconPicker.yml +64 -0
  179. data/lib/starter_web/_data/modules/masonry.yml +1 -1
  180. data/lib/starter_web/_data/modules/masterslider.yml +5 -5
  181. data/lib/starter_web/_data/modules/navigator_menu.yml +150 -41
  182. data/lib/starter_web/_data/modules/scroller.yml +8 -8
  183. data/lib/starter_web/_data/modules/theme_toggler.yml +29 -0
  184. data/lib/starter_web/_data/modules/themer.yml +0 -6
  185. data/lib/starter_web/_data/resources.yml +53 -52
  186. data/lib/starter_web/_data/templates/feed.xml +1 -1
  187. data/lib/starter_web/_includes/attributes.asciidoc +57 -50
  188. data/lib/starter_web/_plugins/asciidoctor/google-ad-block.rb +47 -0
  189. data/lib/starter_web/_plugins/index/lunr.rb +1 -1
  190. data/lib/starter_web/assets/images/icons/mdi/mdi.svg +1 -0
  191. data/lib/starter_web/assets/images/icons/mdi/mdil.svg +1 -0
  192. data/lib/starter_web/assets/images/modules/attics/1920x1280/alexander-redl.jpg +0 -0
  193. data/lib/starter_web/assets/images/modules/attics/1920x1280/alina-grubnyak.jpg +0 -0
  194. data/lib/starter_web/assets/images/modules/attics/1920x1280/andrea-badino.jpg +0 -0
  195. data/lib/starter_web/assets/images/modules/attics/1920x1280/brad-neathery.jpg +0 -0
  196. data/lib/starter_web/assets/images/modules/attics/1920x1280/bruno-figueiredo.jpg +0 -0
  197. data/lib/starter_web/assets/images/modules/attics/1920x1280/clem-onojeghuo.jpg +0 -0
  198. data/lib/starter_web/assets/images/modules/attics/1920x1280/core_web_vitals_best.png +0 -0
  199. data/lib/starter_web/assets/images/modules/attics/1920x1280/crawford-jolly.jpg +0 -0
  200. data/lib/starter_web/assets/images/modules/attics/1920x1280/eleni-afiontzi.jpg +0 -0
  201. data/lib/starter_web/assets/images/modules/attics/1920x1280/fly-d.jpg +0 -0
  202. data/lib/starter_web/assets/images/modules/attics/1920x1280/guillaume-bolduc.jpg +0 -0
  203. data/lib/starter_web/assets/images/modules/attics/1920x1280/harpal-singh.jpg +0 -0
  204. data/lib/starter_web/assets/images/modules/attics/1920x1280/hayden-mills-2.jpg +0 -0
  205. data/lib/starter_web/assets/images/modules/attics/1920x1280/j1-content-mockup-1.jpg +0 -0
  206. data/lib/starter_web/assets/images/modules/attics/1920x1280/j1-content-mockup-2.jpg +0 -0
  207. data/lib/starter_web/assets/images/modules/attics/1920x1280/j1-content-mockup-3.jpg +0 -0
  208. data/lib/starter_web/assets/images/modules/attics/1920x1280/j1-starter-mockup-1.jpg +0 -0
  209. data/lib/starter_web/assets/images/modules/attics/1920x1280/john-schnobrich-2.jpg +0 -0
  210. data/lib/starter_web/assets/images/modules/attics/1920x1280/josep-martins.jpg +0 -0
  211. data/lib/starter_web/assets/images/modules/attics/1920x1280/josh-liu.jpg +0 -0
  212. data/lib/starter_web/assets/images/modules/attics/1920x1280/kelly-sikkemal.jpg +0 -0
  213. data/lib/starter_web/assets/images/modules/attics/1920x1280/kira-auf-der-heide.jpg +0 -0
  214. data/lib/starter_web/assets/images/modules/attics/1920x1280/kristopher-roller.jpg +0 -0
  215. data/lib/starter_web/assets/images/modules/attics/1920x1280/kristopher-roller.webp +0 -0
  216. data/lib/starter_web/assets/images/modules/attics/1920x1280/matthaeus.jpg +0 -0
  217. data/lib/starter_web/assets/images/modules/attics/1920x1280/melanie-deziel.jpg +0 -0
  218. data/lib/starter_web/assets/images/modules/attics/1920x1280/milad-fakurian.jpg +0 -0
  219. data/lib/starter_web/assets/images/modules/attics/1920x1280/mohammad-rahmani.jpg +0 -0
  220. data/lib/starter_web/assets/images/modules/attics/1920x1280/nasa.jpg +0 -0
  221. data/lib/starter_web/assets/images/modules/attics/1920x1280/quino-al-2.jpg +0 -0
  222. data/lib/starter_web/assets/images/modules/attics/1920x1280/recha-oktaviani.jpg +0 -0
  223. data/lib/starter_web/assets/images/modules/attics/building-blocks-1920x1280.jpg +0 -0
  224. data/lib/starter_web/assets/images/modules/attics/christina-1920x1280.jpg +0 -0
  225. data/lib/starter_web/assets/images/modules/attics/cookies-1920x1200.jpg +0 -0
  226. data/lib/starter_web/assets/images/modules/attics/katie-moum-1920x1280.jpg +0 -0
  227. data/lib/starter_web/assets/images/pages/core_web_vitals/core_web_vitals_best.jpg +0 -0
  228. data/lib/starter_web/assets/images/pages/core_web_vitals/core_web_vitals_best.png +0 -0
  229. data/lib/starter_web/assets/images/pages/core_web_vitals/core_web_vitals_best_full.png +0 -0
  230. data/lib/starter_web/assets/images/pages/html_validator/appdevtools-html-validator.jpg +0 -0
  231. data/lib/starter_web/assets/images/pages/html_validator/freeformatter-html-validator.jpg +0 -0
  232. data/lib/starter_web/assets/images/pages/html_validator/w3c-nu-checker.jpg +0 -0
  233. data/lib/starter_web/assets/images/pages/html_validator/w3c-validator.jpg +0 -0
  234. data/lib/starter_web/collections/_biography/a-life-in-questions.adoc +8 -9
  235. data/lib/starter_web/collections/_biography/becoming.adoc +22 -9
  236. data/lib/starter_web/collections/_biography/born-to-run.adoc +27 -9
  237. data/lib/starter_web/collections/_biography/forty-autumns.adoc +19 -12
  238. data/lib/starter_web/collections/_biography/not-dead-yet.adoc +24 -14
  239. data/lib/starter_web/collections/_biography/princess-diarist-the.adoc +23 -14
  240. data/lib/starter_web/collections/_biography/when-breath-becomes-air.adoc +24 -11
  241. data/lib/starter_web/collections/_fantasy/harry-potter-deathly-hallows.adoc +14 -10
  242. data/lib/starter_web/collections/_fantasy/harry-potter-philosophers-stone.adoc +11 -8
  243. data/lib/starter_web/collections/_fantasy/mistborn-trilogy.adoc +7 -8
  244. data/lib/starter_web/collections/_fantasy/ready-player-one.adoc +17 -14
  245. data/lib/starter_web/collections/_fantasy/sword-of-destiny.adoc +12 -13
  246. data/lib/starter_web/collections/_fantasy/terry-pratchet-diary.adoc +15 -15
  247. data/lib/starter_web/collections/_people/diana-petersen.adoc +2 -0
  248. data/lib/starter_web/collections/_people/larry-parker.adoc +2 -0
  249. data/lib/starter_web/collections/_people/parveen-anand.adoc +2 -0
  250. data/lib/starter_web/collections/_portfolio/branding.adoc +5 -0
  251. data/lib/starter_web/collections/_portfolio/graphic_design.adoc +5 -0
  252. data/lib/starter_web/collections/_portfolio/identity.adoc +5 -0
  253. data/lib/starter_web/collections/_portfolio/illustration.adoc +5 -0
  254. data/lib/starter_web/collections/_portfolio/photography.adoc +5 -0
  255. data/lib/starter_web/collections/_portfolio/web_design.adoc +5 -0
  256. data/lib/starter_web/collections/_romance/breath-of-snow-and-ashes-a.adoc +8 -5
  257. data/lib/starter_web/collections/_romance/dressmaker-the.adoc +14 -14
  258. data/lib/starter_web/collections/_romance/fiery-cross-the.adoc +12 -9
  259. data/lib/starter_web/collections/_romance/it-ends-with-us.adoc +14 -11
  260. data/lib/starter_web/collections/_romance/outlander-novel.adoc +48 -25
  261. data/lib/starter_web/collections/_romance/virgins-outlander-short-story.adoc +30 -15
  262. data/lib/starter_web/index.html +6 -14
  263. data/lib/starter_web/package.json +3 -3
  264. data/lib/starter_web/pages/public/about/features.adoc +1 -1
  265. data/lib/starter_web/pages/public/about/reporting_issues.adoc +1 -1
  266. data/lib/starter_web/pages/public/blog/navigator/index.html +2 -2
  267. data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_all_books.adoc +1 -1
  268. data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_biography.adoc +1 -1
  269. data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_fantasy.adoc +1 -1
  270. data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_romance.adoc +1 -1
  271. data/lib/starter_web/pages/public/learn/bookshelf/jekyll_collections.adoc +75 -65
  272. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/attributes.asciidoc +58 -0
  273. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/accordion.asciidoc +34 -0
  274. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/alerts.asciidoc +15 -0
  275. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/badges.asciidoc +9 -0
  276. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/body.asciidoc +14 -0
  277. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/breadcrumbs.asciidoc +14 -0
  278. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/buttons.asciidoc +75 -0
  279. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/cards.asciidoc +22 -0
  280. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/carousel.asciidoc +37 -0
  281. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/close.asciidoc +15 -0
  282. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/code.asciidoc +14 -0
  283. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/color_system.asciidoc +353 -0
  284. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/components.asciidoc +69 -0
  285. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/dropdowns.asciidoc +53 -0
  286. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/figures.asciidoc +5 -0
  287. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/forms.asciidoc +270 -0
  288. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/grid.asciidoc +49 -0
  289. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/links.asciidoc +21 -0
  290. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/list_groups.asciidoc +28 -0
  291. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/modals.asciidoc +43 -0
  292. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/navbar.asciidoc +45 -0
  293. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/navs.asciidoc +28 -0
  294. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/offcanvas.asciidoc +16 -0
  295. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/options.asciidoc +30 -0
  296. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/pagination.asciidoc +40 -0
  297. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/paragraph.asciidoc +5 -0
  298. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/placeholders.asciidoc +5 -0
  299. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/popovers.asciidoc +28 -0
  300. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/position.asciidoc +8 -0
  301. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/progress_bars.asciidoc +12 -0
  302. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/spacing.asciidoc +14 -0
  303. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/spinners.asciidoc +12 -0
  304. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/tables.asciidoc +55 -0
  305. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/thumbnails.asciidoc +9 -0
  306. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/toasts.asciidoc +18 -0
  307. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/tooltips.asciidoc +28 -0
  308. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/typography.asciidoc +115 -0
  309. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/z_index.asciidoc +26 -0
  310. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/tables/_table.asciidoc +9 -0
  311. data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/tables/accordion.asciidoc +87 -0
  312. data/lib/starter_web/pages/public/learn/bs_sass_variables/bs_sass_variables.adoc +262 -0
  313. data/lib/starter_web/pages/public/learn/cheatsheet/gem.adoc +255 -0
  314. data/lib/starter_web/pages/public/learn/cheatsheet/git.adoc +1458 -0
  315. data/lib/starter_web/pages/public/learn/cheatsheet/j1.adoc +63 -0
  316. data/lib/starter_web/pages/public/learn/cheatsheet/yaml.adoc +514 -0
  317. data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/attributes.asciidoc +59 -0
  318. data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/documents/100_chapter.asciidoc +541 -0
  319. data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/documents/200_chapter.asciidoc +33 -0
  320. data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/build_command_options.asciidoc +72 -0
  321. data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/files_and_folders.asciidoc +66 -0
  322. data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/global_configuration_options.asciidoc +63 -0
  323. data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/global_variables.asciidoc +26 -0
  324. data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/page_variables.asciidoc +54 -0
  325. data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/serve_command_options.asciidoc +45 -0
  326. data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/site_variables.asciidoc +59 -0
  327. data/lib/starter_web/pages/public/learn/core_web_vitals/core_web_vitals.adoc +442 -0
  328. data/lib/starter_web/pages/public/learn/roundtrip/_includes/attributes.asciidoc +1 -1
  329. data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/100_gistblock.asciidoc +3 -4
  330. data/lib/starter_web/pages/public/learn/roundtrip/asciidoc_extensions.adoc +2 -2
  331. data/lib/starter_web/pages/public/learn/roundtrip/icon_fonts.adoc +10 -10
  332. data/lib/starter_web/pages/public/learn/roundtrip/present_images.adoc +8 -1
  333. data/lib/starter_web/pages/public/learn/roundtrip/responsive_tables.adoc +3 -3
  334. data/lib/starter_web/pages/public/learn/where_to_go.adoc +39 -45
  335. data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +2 -2
  336. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +2 -2
  337. data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +2 -2
  338. data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +93 -4
  339. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  340. data/lib/starter_web/utilsrv/package.json +1 -1
  341. metadata +133 -24
  342. data/_includes/themes/j1/modules/ads/google_ad_content_home.html +0 -11
  343. data/_includes/themes/j1/modules/ads/google_ad_top_home.html +0 -11
  344. data/assets/themes/j1/core/css/nbinteract-tutorial/styles.css +0 -1711
  345. data/assets/themes/j1/core/css/nbinteract-tutorial/styles.min.css +0 -1
  346. data/assets/themes/j1/modules/advertising/js/google/adInitializer.js +0 -127
  347. data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.2.js +0 -460
  348. data/assets/themes/j1/modules/mdiPreviewer/css/previewer.css +0 -97
  349. data/assets/themes/j1/modules/mdiPreviewer/css/previewer.min.css +0 -15
  350. data/assets/themes/j1/modules/mdiPreviewer/js/previewer.js +0 -115
  351. data/assets/themes/j1/modules/mdiPreviewer/js/previewer.min.js +0 -15
  352. data/assets/themes/j1/modules/mdilPreviewer/css/previewer.css +0 -97
  353. data/assets/themes/j1/modules/mdilPreviewer/css/previewer.min.css +0 -15
  354. data/assets/themes/j1/modules/mdilPreviewer/js/previewer.js +0 -125
  355. data/assets/themes/j1/modules/mdilPreviewer/js/previewer.min.js +0 -15
  356. data/lib/starter_web/_includes/themes/j1/modules/ads/google_ad_content_home.html +0 -11
  357. data/lib/starter_web/_includes/themes/j1/modules/ads/google_ad_top_home.html +0 -11
  358. /data/lib/starter_web/assets/images/{promo → quotes/promo}/home/screenshot.jpg +0 -0
  359. /data/lib/starter_web/assets/images/{promo → quotes/promo}/jekyll/jekyll-faq.jpg +0 -0
  360. /data/lib/starter_web/assets/images/{promo → quotes/promo}/jekyll/jekyll-generator.jpg +0 -0
  361. /data/lib/starter_web/assets/images/{promo → quotes/promo}/jekyll/jekyll-generator.png +0 -0
  362. /data/lib/starter_web/assets/images/{promo → quotes/promo}/jekyll/jekyll-og.png +0 -0
  363. /data/lib/starter_web/assets/images/{promo → quotes/promo}/jekyll/scalable/jekyll-faq.psd +0 -0
@@ -0,0 +1,1458 @@
1
+ ---
2
+ title: Git
3
+ tagline: Sheatsheet for daily use
4
+ date: 2023-05-19 00:00:00 +100
5
+ description: >
6
+ The Cheatsheet discuss Git commands for daily use.
7
+ Many Git commands available from the command line.
8
+ Git offers rich features for version control, collaboration,
9
+ and project management.
10
+ keywords: >
11
+ Jekyll, Theme, JekyllOne, Cheatsheet, Git, Commandline
12
+
13
+ categories: [ Manual ]
14
+ tags: [ Cheatsheet, Git ]
15
+
16
+ image:
17
+ path: /assets/images/modules/attics/1920x1280/recha-oktaviani.jpg
18
+ width: 1920
19
+ height: 1280
20
+ alt: Photo by Recha Oktaviani on Unsplash
21
+
22
+ regenerate: false
23
+ permalink: /pages/public/learn/cheatsheet/git/
24
+
25
+ resources: [ animate, clipboard, rouge ]
26
+ resource_options:
27
+ - attic:
28
+ slides:
29
+ - url: /assets/images/modules/attics/1920x1280/recha-oktaviani.jpg
30
+ alt: Photo by Recha Oktaviani on Unsplash
31
+ badge:
32
+ type: unsplash
33
+ author: Recha Oktaviani
34
+ href: https://unsplash.com/de/@rechaoktaviani
35
+ ---
36
+
37
+ // Page Initializer
38
+ // =============================================================================
39
+ // Enable the Liquid Preprocessor
40
+ :page-liquid:
41
+
42
+ // Set (local) page attributes here
43
+ // -----------------------------------------------------------------------------
44
+ // :page--attr: <attr-value>
45
+
46
+ // Load Liquid procedures
47
+ // -----------------------------------------------------------------------------
48
+ {% capture load_attributes %}themes/{{site.template.name}}/procedures/global/attributes_loader.proc{%endcapture%}
49
+
50
+ // Load page attributes
51
+ // -----------------------------------------------------------------------------
52
+ {% include {{load_attributes}} scope="global" %}
53
+
54
+ // Page content
55
+ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56
+
57
+ // Include sub-documents (if any)
58
+ // -----------------------------------------------------------------------------
59
+ [role="dropcap"]
60
+ The Cheatsheet discuss Git commands for daily use. Many Git commands are available
61
+ from the command line. Git offers rich features for version control,
62
+ collaboration, and project management. You can explore more Git commands
63
+ and options in the official Git documentation.
64
+
65
+ [role="mt-5"]
66
+ == Git status colors
67
+
68
+ In the Git version control system, the output of the git status command can
69
+ be displayed with different colors to provide visual cues about the state of
70
+ your repository. The colors help you quickly identify modified, added,
71
+ deleted, or untracked files, among other things. The specific colors used
72
+ can depend on your terminal configuration, but here are the default colors
73
+ commonly used by Git:
74
+
75
+ * Untracked files: Untracked files are displayed in red color by default.
76
+ These are files that Git is not currently tracking.
77
+ * Modified files: Modified files are displayed in green color by default.
78
+ These files have been modified but still need to be staged for commit.
79
+ * Staged files: Staged files, ready to be committed, are usually displayed
80
+ in a different color from modified files. By default, staged files are
81
+ not assigned a specific color, but they appear in a separate section
82
+ from modified files.
83
+ * Renamed or moved files: Renamed or moved files are displayed in green,
84
+ indicating that they have been renamed or moved since the last commit.
85
+ * Deleted files: Deleted files are displayed in red, indicating that they
86
+ have been removed from the repository.
87
+ * Unmerged files: Unmerged files, resulting from conflicts during a merge
88
+ operation, are typically displayed in a different color, such as yellow or purple.
89
+
90
+ It's important to note that the actual colors displayed may vary depending
91
+ on your terminal configuration and settings. You can customize the colors
92
+ used by Git by modifying your terminal's color scheme or configuring
93
+ Git-specific color options in your Git configuration file (~/.gitconfig).
94
+
95
+ [source, ini]
96
+ ----
97
+ [color "status"]
98
+ ignored = grey
99
+ added = yellow
100
+ changed = green
101
+ deleted = red
102
+ new = orange
103
+ untracked = magenta
104
+ ----
105
+
106
+ .Default color scheme
107
+ [cols="4a,8a", options="header", width="100%", role="rtable mt-3"]
108
+ |===
109
+ |Color |Description
110
+
111
+ |`grey`
112
+ |*Ignored* file or folder by `.gitignore`.
113
+
114
+ |`green`
115
+ |*New* file or folder.
116
+
117
+ |`orange`
118
+ |*Modified* file or folder.
119
+
120
+ |`red`
121
+ |*Deleted* file or folder.
122
+
123
+ |`blue`
124
+ |*Untracked* file or folder (may NOT used by Atom).
125
+
126
+ |===
127
+
128
+
129
+ [role="mt-5"]
130
+ == Git Aliases
131
+
132
+ Git aliases allow you to create shortcuts or alternative names for Git
133
+ commands and workflows, making it easier and faster to execute common
134
+ operations. You can define aliases in your personal Git configuration file
135
+ `~/.gitconfig`, either globally for all repositories or locally for a
136
+ specific repository.
137
+
138
+ [source, ini]
139
+ ----
140
+ [alias]
141
+ ad = add .
142
+ br = branch
143
+ co = commit -am
144
+ cs = commit --amend --no-edit
145
+ ce = commit --amend
146
+ cr = reset HEAD~1 --soft
147
+ cd = reset HEAD~1 --hard
148
+ cl = clone
149
+ ck = checkout
150
+ df = diff
151
+ dw = diff --word-diff
152
+ he = help
153
+ hi = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
154
+ la = ls-files
155
+ ll = ls-tree --full-tree -r --name-only HEAD
156
+ lg = log --stat
157
+ pu = push
158
+ rm = rm -r --cached .
159
+ rf = rm -rf --cached .
160
+ st = status
161
+ ty = 'cat-file'
162
+ ----
163
+
164
+ [role="mt-5"]
165
+ == Branch Commands
166
+
167
+ Git is a distributed version control system that allows you to manage
168
+ multiple code branches within a repository. A branch in is used to keep
169
+ your *changes* until they are *ready*. You can do your work on a branch
170
+ like *develop* while the main branch (main) remains stable (unchanged).
171
+ After you are done (on the branch *develop* for example), you can *merge*
172
+ the changes it to the main branch for a new stable version.
173
+
174
+ [cols="3a, 4a, 5a", options="header", width="100%", role="rtable mt-3 mb-5"]
175
+ |===
176
+ |Command |Description |Example
177
+
178
+ |`branch`
179
+ |Display a list of *local* branches in your repository.
180
+ |
181
+ [source, sh]
182
+ ----
183
+ git branch
184
+ ----
185
+
186
+ |`branch -a`
187
+ |Display a list of both *local* and *remote* branches in your repository.
188
+ |
189
+ [source, sh]
190
+ ----
191
+ git branch -a
192
+ ----
193
+
194
+ |`branch -d <branch-name>`
195
+ |Delete a *local* branch. This will *not* work if the branch to
196
+ delete *has unmerged changes*.
197
+ |
198
+ [source, sh]
199
+ ----
200
+ git branch -d dummy_branch
201
+ ----
202
+
203
+ |`branch -D <branch-name>`
204
+ |Delete a *local* branch *with unmerged changes*.
205
+ |
206
+ [source, sh]
207
+ ----
208
+ git branch -D dummy_branch
209
+ ----
210
+
211
+ |`branch -m <branch-name> <new-branch-name>`
212
+ |Rename a *local* branch.
213
+ |
214
+ [source, sh]
215
+ ----
216
+ git branch -m master main
217
+ ----
218
+
219
+ |`branch -m <branch-name>`
220
+ |Rename the *current* local branch
221
+ |
222
+ [source, sh]
223
+ ----
224
+ git branch -m main
225
+ ----
226
+
227
+ |`branch -r`
228
+ |Display a list of *remote* branches in your repository.
229
+ |
230
+ [source, sh]
231
+ ----
232
+ git branch -r
233
+ ----
234
+
235
+ |`push <remote> --delete <remote branch>`
236
+ |Delete a *remote* branch.
237
+ |
238
+ [source, sh]
239
+ ----
240
+ git push origin --delete dummy_branch
241
+ ----
242
+
243
+ |`push --set-upstream <remote branch>`
244
+ |Set an *upstream* branch. Running this command will push your *local*
245
+ branch to the new *remote* branch.
246
+ |
247
+ [source, sh]
248
+ ----
249
+ git push --set-upstream dummy_branch
250
+ ----
251
+ |===
252
+
253
+
254
+ == Checkout Commands
255
+
256
+ The `git checkout` command is used to *switch* between *branches*,
257
+ create new branches, or restore files to a *previous state*.
258
+
259
+ [cols="3a, 4a, 5a", options="header", width="100%", role="rtable mt-3 mb-5"]
260
+ |===
261
+ |Command |Description |Example
262
+
263
+ |`checkout <branch-name>`
264
+ |Switch to a different branch.
265
+ |
266
+ [source, sh]
267
+ ----
268
+ git checkout main
269
+ ----
270
+
271
+ |`checkout -b <branch-name>`
272
+ |*Create* a new branch and switch to it.
273
+ |
274
+ [source, sh]
275
+ ----
276
+ git checkout -b develop
277
+ ----
278
+
279
+ |`checkout -b <branch-name> <remote-name>/<branch-name>`
280
+ |Create a *local* branch from a *remote* (branch) and checkout that branch.
281
+ |
282
+ [source, sh]
283
+ ----
284
+ git checkout -b dummy origin/dummy_branch
285
+ ----
286
+
287
+ |`checkout <commit hash>`
288
+ |Checkout from a *previously* created (existing) commit.
289
+ |
290
+ [source, sh]
291
+ ----
292
+ git checkout 4b4690d00
293
+ ----
294
+
295
+ |`checkout -b <branch-name> <commit hash>`
296
+ |Checkout from a *previously* created (existing) commit `<commit hash>`
297
+ to a new *local* branch `<branch-name>`.
298
+ |
299
+ [source, sh]
300
+ ----
301
+ git checkout -b new_branch 4b4690d00
302
+ ----
303
+
304
+ |`checkout <tag name>`
305
+ |Checkout a branch based on a *tag* in a detached HEAD state.
306
+ |
307
+ [source, sh]
308
+ ----
309
+ git checkout v2023.2.6
310
+ ----
311
+
312
+ |`checkout -b <branch-name> <tag-name>`
313
+ |Checkout a *new* local branch `<branch-name>` based on a *tag*.
314
+ |
315
+ [source, sh]
316
+ ----
317
+ git checkout -b b2023.2.6 v2023.2.6
318
+ ----
319
+
320
+ |===
321
+
322
+ .Detached HEAD state
323
+ [TIP]
324
+ ====
325
+ In Git, the *detached HEAD* state refers to a situation where the
326
+ currently checked out commit is *not* associated with a *branch*. Instead
327
+ of being on a branch, the HEAD points directly to a specific *commit*.
328
+
329
+ When you typically work on a branch in Git, the HEAD is associated with that
330
+ branch, and any new commits you create will be added to the branch's history.
331
+ However, in a detached HEAD state, any new commits you create will not be
332
+ part of any branch. The HEAD points directly to the commit.
333
+ ====
334
+
335
+ [role="mt-5"]
336
+ == Cherry Pick Commands
337
+
338
+ The `git cherry-pick` command is used to apply *specific commits* from
339
+ one branch to another. It lets you pick *individual commits* and apply
340
+ them to the *current branch*.
341
+
342
+ CAUTION: Some commonly used `cherry-pick` commands allow you to apply
343
+ commits from one branch to another selectively. It is important to note
344
+ that cherry-picking can introduce *conflicts*, especially if the same
345
+ changes have been made in *different* branches.
346
+
347
+ The command takes changes from a target commit and places them on
348
+ the HEAD of the currently checked out branch. From here, you can either
349
+ continue working with these changes in your working directory or you can
350
+ immediately commit the changes onto the new branch.
351
+
352
+ [cols="3a, 4a, 5a", options="header", width="100%", role="rtable mt-3 mb-5"]
353
+ |===
354
+ |Command |Description |Example
355
+
356
+ |`cherry-pick <commit_hash>`
357
+ |Apply a commit’s changes onto a different branch.
358
+ |
359
+ [source, sh]
360
+ ----
361
+ git cherry-pick <commit_hash>
362
+ ----
363
+
364
+ |`cherry-pick <commit_hash1> <commit_hash2>`
365
+ |Apply changes from multiple commits to the current branch. The commits are
366
+ applied in the order specified.
367
+ |
368
+ [source, sh]
369
+ ----
370
+ git cherry-pick <commit_hash1> <commit_hash2>
371
+ ----
372
+
373
+ |`cherry-pick -n <commit_hash>`
374
+ |Perform a *no commit* cherry-pick, which applies the changes from the
375
+ specified commit but does not create a new commit. This allows you to
376
+ modify the changes before committing them.
377
+ |
378
+ [source, sh]
379
+ ----
380
+ git cherry-pick -n <commit_hash>
381
+ ----
382
+
383
+ |`cherry-pick --edit <commit_hash>`
384
+ |Opens the commit message editor before committing the cherry-picked
385
+ changes. It allows you to modify the commit message.
386
+ |
387
+ [source, sh]
388
+ ----
389
+ git cherry-pick --edit <commit_hash>
390
+ ----
391
+
392
+ |`cherry-pick --continue`
393
+ |Continues the cherry-pick process after resolving any conflicts that
394
+ occurred during the cherry-pick operation.
395
+ |
396
+ [source, sh]
397
+ ----
398
+ git cherry-pick --continue
399
+ ----
400
+
401
+ |`cherry-pick --abort`
402
+ |Aborts the cherry-pick operation and returns the branch to its original
403
+ state before the cherry-pick was started.
404
+ |
405
+ [source, sh]
406
+ ----
407
+ git cherry-pick --abort
408
+ ----
409
+
410
+ |===
411
+
412
+ TIP: The cherry pick command can be helpful if you accidentally make a
413
+ commit to the *wrong branch*. Cherry picking allows you to get those
414
+ changes onto the correct branch without redoing any work. After the
415
+ commit it’s been cherry picked, you can either continue working
416
+ with the changes before committing, or you can immediately commit
417
+ the changes onto the target branch.
418
+
419
+
420
+ [role="mt-5"]
421
+ == Clone Commands
422
+
423
+ The git clone command creates a copy of a Git repository in a new directory.
424
+ It retrieves the entire repository, including all its files, branches, and
425
+ commit history.
426
+
427
+ [cols="3a, 4a, 5a", options="header", width="100%", role="rtable mt-3 mb-3"]
428
+ |===
429
+ |Command |Description |Example
430
+
431
+ |`clone <repository-url>`
432
+ |Clone a specified remote repository.
433
+ |
434
+ [source, sh]
435
+ ----
436
+ git clone <repository-url>
437
+ ----
438
+
439
+ |`clone <repository-url> <directory-name>`
440
+ |Clone a repository and name the local directory.
441
+ |
442
+ [source, sh]
443
+ ----
444
+ git clone <repository-url> <directory-name>
445
+ ----
446
+
447
+ |`clone <repository-url> --origin <name>`
448
+ |Clone a repository and name the remote (`<name>`). If you do not wish
449
+ to name the remote, Git will provide the default name `origin`.
450
+ |
451
+ [source, sh]
452
+ ----
453
+ git clone <repository-url> --origin <name>
454
+ ----
455
+
456
+ |`clone <repository-url> --branch <branch-name>`
457
+ |Clone a repository and checkout the specific branch. 
458
+ |
459
+ [source, sh]
460
+ ----
461
+ git clone <repository-url> --branch <branch-name>
462
+ ----
463
+
464
+ |`clone <repository-url> --depth <depth>`
465
+ |Clone a repository with a specified number of commits (`<depth>`). 
466
+ |
467
+ [source, sh]
468
+ ----
469
+ git clone <repository-url> --depth <depth>
470
+ ----
471
+
472
+ |`clone <repository-url> --no-tags`
473
+ |Clone a repository without copying the repo’s tags.
474
+ |
475
+ [source, sh]
476
+ ----
477
+ git clone <repository-url> --no-tags
478
+ ----
479
+
480
+ |===
481
+
482
+ [role="mb-4"]
483
+ Here’s what each part of the command means:
484
+
485
+ * `<repository_url>`, this is the repository URL you want to clone. It can
486
+ be a *remote* repository URL (e.g., on GitHub or GitLab) or a *local path*
487
+ to a repository.
488
+ * `<directory_name>` (optional), this is the directory name where the
489
+ repository will be cloned. Git will create a new directory using the
490
+ repository's name if not specified.
491
+
492
+
493
+ [role="mt-5"]
494
+ == Commit Commands
495
+
496
+ The git `commit` command is used to record *changes* to the repository. It
497
+ creates a new *commit* that includes the changes you have made to your files.
498
+ Commits serve as *snapshots* of the repository at a specific point in time
499
+ and form the basis of the Git version control system.
500
+
501
+ Here's what each part of the command means:
502
+
503
+ * `-m <commit_message>`, this option allows you to provide a commit message
504
+ describing the commit changes made. The commit message should be concise
505
+ but informative, summarizing the purpose or nature of the changes.
506
+
507
+ Additionally, you can use various options and flags with the git commit
508
+ command to modify its behavior. Some commonly used options include:
509
+
510
+ * `-a`, automatically stages all modified files before committing.
511
+ * `-am <commit_message>`, combines the `-a` and `-m` options, allowing
512
+ you to automatically stage modified files and provide a commit message
513
+ in a *single* command.
514
+ * `-p`, interactively selects and commits changes from specific hunks within
515
+ modified files.
516
+
517
+ To make a commit, you typically follow these steps:
518
+
519
+ . Make changes to your files in the repository using any text editor or IDE.
520
+ . Use the git add command to stage the changes you want to include in the commit.
521
+ The add option tells Git which files should be part of the commit. For
522
+ example, you can use git add `.` (dot) to stage all changes in the current
523
+ directory.
524
+ . Once you have staged the changes, use the git commit command to create a
525
+ new commit. Provide a meaningful *commit message* using the `-m` option.
526
+
527
+ After executing the commit command, Git will create a new commit with your
528
+ staged changes. The commit will be assigned a *unique identifier*, a
529
+ SHA-1 hash, and added to the repository's commit *history*.
530
+
531
+ [cols="3a, 4a, 5a", options="header", width="100%", role="rtable mt-3 mb-5"]
532
+ |===
533
+ |Command |Description |Example
534
+
535
+ |`status`
536
+ |Display a list of files in your staging directory with accompanying
537
+ file status.
538
+ |
539
+ [source, sh]
540
+ ----
541
+ git status
542
+ ----
543
+
544
+ |`add`
545
+ |Stage file changes. Running this command with an associated file name
546
+ will stage the file changes to your staging directory.
547
+ | Commit *all* files iin the *current* folder indicazed by `.` (dot)
548
+ [source, sh]
549
+ ----
550
+ git add .
551
+ ----
552
+
553
+ |`commit`
554
+ |Save changes to your Git repository. Running this command with an
555
+ associated file name will save the file changes to your repo.
556
+ |
557
+ [source, sh]
558
+ ----
559
+ git commit
560
+ ----
561
+
562
+ |`commit -a`
563
+ |Add all modified and deleted files in your working directory to the
564
+ current commit.
565
+ |
566
+ [source, sh]
567
+ ----
568
+ git commit -a
569
+ ----
570
+
571
+ |`commit --amend -m "New commit message"`
572
+ |Amend a Git commit. Edit a Git commit message by adding a message in
573
+ quotation marks after the command.
574
+ |
575
+ [source, sh]
576
+ ----
577
+ commit --amend -m "New commit message"
578
+ ----
579
+
580
+ |`commit -m "message text"`
581
+ |Add a Git commit message. Add your message in quotation marks
582
+ following the command.
583
+ |
584
+ [source, sh]
585
+ ----
586
+ git commit -m "message text"
587
+ ----
588
+
589
+ |`commit -am "message text"`
590
+ |Combine options `a` and `m` to add all modified and deleted files and
591
+ provide a commit message in a *single* command.
592
+ |
593
+ [source, sh]
594
+ ----
595
+ git commit -am "message text"
596
+ ----
597
+
598
+ |===
599
+
600
+
601
+ == Config Commands
602
+
603
+ Git config commands configure various aspects of Git, such as user
604
+ information, default behavior, aliases, etc. Here are some commonly
605
+ used Git config commands:
606
+
607
+ [cols="3a, 4a, 5a", options="header", width="100%", role="rtable mt-3 mb-5"]
608
+ |===
609
+ |Command |Description |Example
610
+
611
+ |`config --global user.email "email@address"`
612
+ |Sets the *email address* associated with your Git commits and
613
+ other Git actions.
614
+ |
615
+ [source, sh]
616
+ ----
617
+ git config --global user.email "my@mail.address"
618
+ ----
619
+
620
+ |`config --global user.name "name"`
621
+ |Sets the *user name* associated with your Git commits and other
622
+ Git actions.
623
+ |
624
+ [source, sh]
625
+ ----
626
+ git config --global user.name "My Name"
627
+ ----
628
+
629
+ |`config --global core.editor "editor"`
630
+ |Sets the text editor Git should use when creating commit messages.
631
+ Replace [editor] with your preferred text editor (e.g., "vim," "nano,"
632
+ "subl" for Sublime Text). On *Windows*, set the *path* to your
633
+ preferred editor like `C:/Program Files (x86)/Notepad++/notepad++.exe`.
634
+ |
635
+ [source, sh]
636
+ ----
637
+ git config --global core.editor "vim"
638
+ ----
639
+
640
+ |`config --list`
641
+ |Lists *all* the Git configuration settings currently set on your system.
642
+ |
643
+ [source, sh]
644
+ ----
645
+ git config --list
646
+ ----
647
+
648
+ |`config --local --edit`
649
+ |Opens the Git configuration file fron the current *repo* (`.git/config`)
650
+ in the default text editor, allowing you to *manually* edit the settings.
651
+ |
652
+ [source, sh]
653
+ ----
654
+ git config --local --edit
655
+ ----
656
+
657
+ |`config --global --edit`
658
+ |Opens your *personal* Git configuration file (`~/.gitconfig`) from the
659
+ *home* directory in the default text editor, allowing you to *manually*
660
+ edit the settings.
661
+ |
662
+ [source, sh]
663
+ ----
664
+ git config --global --edit
665
+ ----
666
+
667
+ |`config --system --edit`
668
+ |Opens the Git *application* configuration file (`<Git folder>/etc/gitconfig`)
669
+ in the default text editor, allowing you to *manually* edit the settings.
670
+ |
671
+ [source, sh]
672
+ ----
673
+ git config --system --edit
674
+ ----
675
+
676
+ |===
677
+
678
+
679
+ [role="mt-5"]
680
+ == Merge Commands
681
+
682
+ When using Git, several commands are available to perform a merge operation.
683
+ The most commonly used commands for merging branches are `git merge` and
684
+ `git pull` (see <<Pull Commands>>).
685
+
686
+ Here's an overview of these commands:
687
+
688
+ [cols="3a, 4a, 5a", options="header", width="100%", role="rtable mt-3 mb-3"]
689
+ |===
690
+ |Command |Description |Example
691
+
692
+ |`merge`
693
+ |Combine two or more development histories together. Used in
694
+ combination with fetch, this will combine the fetched history
695
+ from a remote branch into the currently checked out local branch.
696
+ |
697
+ [source, sh]
698
+ ----
699
+ git merge
700
+ ----
701
+
702
+ |`merge <branch-name>`
703
+ |Merge changes from one branch into the branch you currently
704
+ have checked out.
705
+ |
706
+ [source, sh]
707
+ ----
708
+ git merge develop
709
+ ----
710
+
711
+ |`merge --abort`
712
+ |Aborts the merge process and restores project’s state
713
+ to before the merge was attempted. This works as a failsafe when
714
+ a conflict occurs.
715
+ |
716
+ [source, sh]
717
+ ----
718
+ git merge --abort develop
719
+ ----
720
+
721
+ |`merge --continue`
722
+ |Attempt to complete a merge that was stopped due to file conflicts
723
+ after *resolving* the merge *conflict*.
724
+ |
725
+ [source, sh]
726
+ ----
727
+ git merge --continue develop
728
+ ----
729
+
730
+ |`merge --squash`
731
+ |Combine all changes from the branch being merged into a single
732
+ commit rather than preserving them as individual commits.
733
+ |
734
+ [source, sh]
735
+ ----
736
+ git merge --squash
737
+ ----
738
+
739
+ |`merge --no-commit`
740
+ |Combine branch into the current branch, but do not make a new commit.
741
+ |
742
+ [source, sh]
743
+ ----
744
+ git merge --no-commit develop
745
+ ----
746
+
747
+ |`merge --no-ff`
748
+ |Creates a merge commit instead of attempting a *fast-forward*.
749
+ |
750
+ [source, sh]
751
+ ----
752
+ git merge --no-ff develop
753
+ ----
754
+
755
+ |===
756
+
757
+ TIP: These are the basic commands for merging branches in Git. Additionally,
758
+ you can use some more options and flags with these commands to modify their
759
+ behavior. I recommend consulting the Git documentation for a more comprehensive
760
+ understanding of the available options and scenarios where merging can be
761
+ used effectively.
762
+
763
+
764
+ [role="mt-5"]
765
+ == Pull Commands
766
+
767
+ The `git pull` command *fetches* and *merges* changes from a remote repository
768
+ into the *current branch*. Here's an overview of the `pull` command and
769
+ its commonly used options:
770
+
771
+ [cols="3a, 4a, 5a", options="header", width="100%", role="rtable mt-3 mb-3"]
772
+ |===
773
+ |Command |Description |Example
774
+
775
+ |`pull`
776
+ |This command fetches, and merges changes from the *remote* repository into
777
+ your current *local* branch.
778
+ |
779
+ [source, sh]
780
+ ----
781
+ git pull
782
+ ----
783
+
784
+ |`pull --quiet`
785
+ |Suppress the output text after both `git fetch` and `git merge`.
786
+ |
787
+ [source, sh]
788
+ ----
789
+ git pull --quiet
790
+ ----
791
+ |`pull --verbose`
792
+ |Expand the output text after both `git fetch` and `git merge`.
793
+ |
794
+ [source, sh]
795
+ ----
796
+ git pull --verbose
797
+ ----
798
+
799
+ |===
800
+
801
+ === Commands related to a `merge`
802
+
803
+ When performing a `git pull` command, you typically *fetch and merge* the
804
+ latest changes from a remote repository into your current branch. Here
805
+ are some common scenarios related to merging during a `pull`:
806
+
807
+ * `git pull --squash` – Combine all changes from the branch being
808
+ merged into a single commit, rather than preserving the individual
809
+ commits.
810
+ * `git pull --no-commit` – Combine the currently checked out
811
+ branch with the remote upstream branch.
812
+ * `git pull --no-ff` –  Create a merge commit in all cases, even
813
+ when the merge could instead be resolved as a fast-forward.
814
+
815
+ === Commands related to a `fetch`
816
+
817
+ When using Git, the `git pull` command *fetches and merges* changes from a
818
+ remote repository into your local repository. It combines the `git fetch`
819
+ command (to retrieve the latest changes from the remote repository) with
820
+ the `git merge` command (to incorporate those changes into your local branch).
821
+
822
+ Here are some `git pull` commands and related options you can use in
823
+ different scenarios:
824
+
825
+ * `git pull --all`  – Fetch all remotes. 
826
+ * `git pull --depth=<depth>` – Fetch a limited number of commits. 
827
+ * `git pull --dry-run` – Show the action that would be completed
828
+ without actually making changes to your repo.
829
+ * `git pull --prune` – Remove all remote references that no longer
830
+ exist on the remote.
831
+ * `git pull --no-tags` – Do not fetch tags.
832
+
833
+
834
+ [role="mt-5"]
835
+ == Push Commands
836
+
837
+ The `git push` command *uploads* local repository commits to a *remote*
838
+ repository. It is used to share your changes with others or to update
839
+ a remote repository with your latest work. Here's an overview of the `push`
840
+ command and its commonly used options:
841
+
842
+ [cols="3a, 4a, 5a", options="header", width="100%", role="rtable mt-3 mb-3"]
843
+ |===
844
+ |Command |Description |Example
845
+
846
+ |`push`
847
+ |Push the current checked out branch to the *default* remote `origin`. 
848
+ |
849
+ [source, sh]
850
+ ----
851
+ git push
852
+ ----
853
+
854
+ |`push <remote> <branch>`
855
+ |Push the specified *local* branch along with all of its necessary commits
856
+ to your destination *remote* repository. 
857
+ |
858
+ [source, sh]
859
+ ----
860
+ git push origin main
861
+ ----
862
+
863
+ |`push <remote> --force`
864
+ |Force a Git push in a non-fast-forward merge. This option forces
865
+ the update of a remote ref even when that is not the ancestor of the
866
+ local ref. This can cause the remote repository to loose commits,
867
+ so use with care.
868
+ |
869
+ [source, sh]
870
+ ----
871
+ git push <remote> --force
872
+ ----
873
+
874
+ |`push <remote> --all`
875
+ |Push *all* local branches to a specified remote.
876
+ |
877
+ [source, sh]
878
+ ----
879
+ git push <remote> --all
880
+ ----
881
+
882
+ |`git push <remote> --tags`
883
+ |Push all local tags to a specified remote (can ommitted for *default* remote).
884
+ Note that tags are *not* automatically sent when using `--all`.
885
+ |
886
+ [source, sh]
887
+ ----
888
+ git push origin --tags
889
+ ----
890
+
891
+ |===
892
+
893
+
894
+ [role="mt-5"]
895
+ == Rebase Commands
896
+
897
+ The `git rebase` command that integrates changes from one branch onto
898
+ another. It allows you to modify the *commit history* of a branch by
899
+ moving, combining, or deleting commits.
900
+
901
+ Here are some commonly used Git rebase commands:
902
+
903
+ [cols="3a, 4a, 5a", options="header", width="100%", role="rtable mt-3 mb-3"]
904
+ |===
905
+ |Command |Description |Example
906
+
907
+ |`rebase <target branch name>`
908
+ |Rebase your currently checked out branch onto a target branch.
909
+ This rewrites a commit(s) from the source branch and applies it on
910
+ the top of the target branch.
911
+ |
912
+ [source, sh]
913
+ ----
914
+ git rebase <target branch name>
915
+ ----
916
+
917
+ |`rebase --continue`
918
+ |Proceed with a Git rebase after you have resolved a conflict
919
+ between files.
920
+ |
921
+ [source, sh]
922
+ ----
923
+ git rebase --continue
924
+ ----
925
+
926
+ |`rebase --skip`
927
+ |Skip an action that results in a conflict to proceed with a Git rebase.
928
+ |
929
+ [source, sh]
930
+ ----
931
+ git rebase --skip
932
+ ----
933
+
934
+ |`rebase --abort`
935
+ |Cancel a Git rebase. Your branch will be back in the state it was
936
+ before you started the rebase.
937
+ |
938
+ [source, sh]
939
+ ----
940
+ git rebase --abort
941
+ ----
942
+
943
+ |`rebase <target branch name> -i`
944
+ |Initiate interactive rebase from your currently checked
945
+ out branch onto a target branch.
946
+ |
947
+ [source, sh]
948
+ ----
949
+ git rebase <target branch name> -i
950
+ ----
951
+
952
+ |===
953
+
954
+ CAUTION: The command `rebase` is a flexible way to *manipulate* the commit
955
+ *history*. Still, it's important to use it *cautiously*, especially when
956
+ working on *shared* branches (like the *main* branch), as it rewrite the
957
+ commit history and potentially cause issues for other collaborators.
958
+
959
+
960
+ [role="mt-5"]
961
+ == Stash Commands
962
+
963
+ Git stash is a command that *temporarily* saves *changes* you have made to
964
+ your working directory so that you can switch to a different branch or
965
+ apply the changes *later*.
966
+
967
+ Here are some commonly used stash commands:
968
+
969
+ [cols="3a, 4a, 5a", options="header", width="100%", role="rtable mt-3 mb-3"]
970
+ |===
971
+ |Command |Description |Example
972
+
973
+ |`stash`
974
+ |Create a stash with local modifications and revert back to the head commit.
975
+ |
976
+ [source, sh]
977
+ ----
978
+ git stash
979
+ ----
980
+
981
+ |`stash list`
982
+ |Display a list of all stashes in your repository.
983
+ |
984
+ [source, sh]
985
+ ----
986
+ git stash list
987
+ ----
988
+
989
+ |`stash show`
990
+ |View the content of your most recent stash. This will show your
991
+ stashed changes as a diff between the stashed content and the commit
992
+ from back when the stash was created.
993
+ |
994
+ [source, sh]
995
+ ----
996
+ git stash show
997
+ ----
998
+
999
+ |`stash drop <stash>`
1000
+ |Remove a stash from the list of stashes in your repository.
1001
+ |
1002
+ [source, sh]
1003
+ ----
1004
+ git stash drop <stash>
1005
+ ----
1006
+
1007
+ |`stash pop <stash>`
1008
+ |Apply a stash to the top of the current working tree and remove
1009
+ it from your list of stashes.
1010
+ |
1011
+ [source, sh]
1012
+ ----
1013
+ git stash pop <stash>
1014
+ ----
1015
+
1016
+ |`stash apply <stash>`
1017
+ |Apply a stash on top of the current working tree. The stash
1018
+ will not be removed from your list of stashes.
1019
+ |
1020
+ [source, sh]
1021
+ ----
1022
+ git stash apply <stash>
1023
+ ----
1024
+
1025
+ |`stash clear`
1026
+ |Remove all stashes from your repository.
1027
+ |
1028
+ [source, sh]
1029
+ ----
1030
+ git stash clear
1031
+ ----
1032
+
1033
+ |===
1034
+
1035
+ TIP: Stashing is useful when *switching* branches or *temporarily*
1036
+ setting aside your changes *without committing* them. It allows you to
1037
+ work on different tasks or switch contexts without losing your current work.
1038
+
1039
+
1040
+ [role="mt-5"]
1041
+ == Common commands
1042
+
1043
+ Find some already *prepared* Git commands used quite often.
1044
+
1045
+ === Clearing the index
1046
+
1047
+ The commands below will *remove* all of the items from the Git *index* (not
1048
+ from the *working directory* or local repo) and then (re-)update from
1049
+ local folder `.`.
1050
+
1051
+ .Clear the index and re-add all files
1052
+ [source, sh]
1053
+ ----
1054
+ git rm -r --cached . && git add .
1055
+ ----
1056
+
1057
+ or forced
1058
+
1059
+ .Clear the index forced and re-add all files
1060
+ [source, sh]
1061
+ ----
1062
+ git rm -rf --cached . && git add .
1063
+ ----
1064
+
1065
+ === Commit commands
1066
+
1067
+ [cols="3a, 4a, 5a", options="header", width="100%", role="rtable mt-3 mb-3"]
1068
+ |===
1069
+ |Command |Description |Example
1070
+
1071
+ |`commit -am "Cleanup files"`
1072
+ |Commit when files are *cleaned*. *No* files are changed but some *deleted*.
1073
+ |
1074
+ [source, sh]
1075
+ ----
1076
+ git commit -am "Cleanup files"
1077
+ ----
1078
+
1079
+ |`commit -am "New version 2023.3.0"`
1080
+ |Commit a specific *version*.
1081
+ |
1082
+ [source, sh]
1083
+ ----
1084
+ git commit -am "New version 2023.3.0"
1085
+ ----
1086
+
1087
+ |`commit --allow-empty -m "New version 2023.3.0"`
1088
+ |Commit a specific version but *no* (file) changes applied.
1089
+ |
1090
+ [source, sh]
1091
+ ----
1092
+ git commit --allow-empty -m "New version 2023.3.0"
1093
+ ----
1094
+
1095
+ |`commit -am "Prepare new version 2023.3.0"`
1096
+ |Commit a specific version but changes are *not* final.
1097
+ |
1098
+ [source, sh]
1099
+ ----
1100
+ git commit -am "Prepare new version 2023.3.0"
1101
+ ----
1102
+
1103
+ |`commit -am "Latest files"`
1104
+ |Commit latest changes but *no* specific reason given.
1105
+ |
1106
+ [source, sh]
1107
+ ----
1108
+ git commit -am "Latest files"
1109
+ ----
1110
+
1111
+ |===
1112
+
1113
+ === Create a new repository on the command line
1114
+
1115
+ [source, sh]
1116
+ ----
1117
+ echo "# Heroku starter_app" >> README.md
1118
+ git init
1119
+ git add README.md
1120
+ git commit -m "initial commit"
1121
+
1122
+ git remote add origin https://github.com/jekyll-one-org/my_heroku_starter_app.git
1123
+ git push -u origin main
1124
+ ----
1125
+
1126
+
1127
+ === Add file permissions on Windows
1128
+
1129
+ Change file permissions *Unix-style* (chmod) when are on Windows. This may
1130
+ helpful when shell scripts are created and *execute* rights are required
1131
+ to be stored in the *repo*.
1132
+
1133
+ [source, sh]
1134
+ ----
1135
+ git update-index --chmod=+x 'name-of-shell-script'
1136
+ ----
1137
+
1138
+ NOTE: See for more details on
1139
+ https://medium.com/@akash1233/change-file-permissions-when-working-with-git-repos-on-windows-ea22e34d5cee[Change file permissions when working on windows, {browser-window--new}]
1140
+
1141
+ === Disable warning `CRLF will be replaced by LF`
1142
+
1143
+ You can turn off the warning with:
1144
+
1145
+ [source, sh]
1146
+ ----
1147
+ git config --global core.safecrlf false
1148
+ ----
1149
+
1150
+ NOTE: This will only turn off the warning, not the *function* itself.
1151
+
1152
+
1153
+
1154
+
1155
+ ////
1156
+ == Make a new commit and create a new message
1157
+
1158
+ Make a new commit and create a new message if no changes are made to files
1159
+
1160
+ [source, sh]
1161
+ ----
1162
+ git commit --allow-empty -m "Test on empty commit"
1163
+ ----
1164
+
1165
+ == Create a new repository on the command line
1166
+
1167
+ [source, sh]
1168
+ ----
1169
+ echo "# Heroku starter_app" >> README.md
1170
+ git init
1171
+ git add README.md
1172
+ git commit -m "initial commit"
1173
+ git remote add origin https://github.com/jekyll-one-org/my_heroku_starter_app.git
1174
+ git push -u origin main
1175
+ ----
1176
+
1177
+ == List branches
1178
+
1179
+ git branch -a zeigt alle lokalen und entfernten Branches an, hingegen -r
1180
+ nur die entfernten Branches anzeigt.
1181
+
1182
+ [source, sh]
1183
+ ----
1184
+ git branch -a
1185
+ git branch -r
1186
+ ----
1187
+
1188
+ == Rename a branch
1189
+
1190
+ If you want to rename a local branch while pointed to `any` branch, do:
1191
+
1192
+ [source, sh]
1193
+ ----
1194
+ git branch -m <oldname> <newname>
1195
+ ----
1196
+
1197
+ If you want to rename the `current` local branch, you can do:
1198
+
1199
+ [source, sh]
1200
+ ----
1201
+ git branch -m <newname>
1202
+ ----
1203
+
1204
+ If you want rename a the local branch *and* push|reset the `upstream` branch:
1205
+
1206
+ [source, sh]
1207
+ ----
1208
+ git push origin -u <newname>
1209
+ git push origin --delete <old_name>
1210
+ ----
1211
+
1212
+ == Push current branch to remote (main)
1213
+
1214
+ [source, sh]
1215
+ ----
1216
+ git push --set-upstream origin main
1217
+ ----
1218
+
1219
+
1220
+ == Create branches
1221
+
1222
+ Create a branch on your local machine *and* switch in this branch:
1223
+
1224
+ [source, sh]
1225
+ ----
1226
+ git checkout -b <name_of_your_new_branch>
1227
+ ----
1228
+
1229
+ NOTE: Git does not allow creating a (new, isolated) branch on a remote
1230
+ repository. Instead, you can push an existing local branch and thereby
1231
+ publish it on a remote repository.
1232
+
1233
+
1234
+ == Delete branches
1235
+
1236
+ See:
1237
+ {https://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-locally-and-remotely}[Stackoverflow]
1238
+
1239
+ === Delete branches from `remote`
1240
+
1241
+ [source, sh]
1242
+ ----
1243
+ git push -d <remote_name> <branch_name>
1244
+ ----
1245
+
1246
+ NOTE: In most cases the remote name is origin. In such a case you'll
1247
+ have to use the command like so.
1248
+
1249
+ [source, sh]
1250
+ ----
1251
+ git push -d origin <branch_name>
1252
+ ----
1253
+
1254
+ === Delete branches from `local`
1255
+
1256
+ [source, sh]
1257
+ ----
1258
+ git branch -d <branch_name>
1259
+ ----
1260
+
1261
+
1262
+ == Create branch from commit
1263
+
1264
+ Create a branch from a previous `commit`:
1265
+
1266
+ [source, sh]
1267
+ ----
1268
+ git branch branch_name <sha1-of-commit>
1269
+ ----
1270
+
1271
+
1272
+ == Reset repo to a commit
1273
+
1274
+ === Reset from `local`
1275
+
1276
+ [source, sh]
1277
+ ----
1278
+ git reset --hard 217a618
1279
+ ----
1280
+
1281
+ === Reset from `remote`
1282
+
1283
+ [source, sh]
1284
+ ----
1285
+ git push --force origin main
1286
+ ----
1287
+
1288
+
1289
+ == Push an existing repository from the command line
1290
+
1291
+ [source, sh]
1292
+ ----
1293
+ git remote add github https://github.com/jekyll-one-org/heroku_starter_app.git
1294
+ git push -u github main
1295
+ ----
1296
+
1297
+
1298
+ == Removing non-repository files with git
1299
+
1300
+ See: https://stackoverflow.com/questions/5037480/removing-non-repository-files-with-git
1301
+
1302
+ If you want to see which files will be deleted you can use the
1303
+ option -n *before* you run the actual command:
1304
+
1305
+ [source, sh]
1306
+ ----
1307
+ git clean -n
1308
+ ----
1309
+
1310
+ You can use git-clean. This command will remove untracked files/directories.
1311
+ By default, it will only print what it would have removed, without actually
1312
+ removing them.
1313
+
1314
+ Given the -f flag to remove the files, and the -d flag to remove empty
1315
+ directories as well:
1316
+
1317
+ [source, sh]
1318
+ ----
1319
+ git clean -df
1320
+ ----
1321
+
1322
+ Also removing ignored files:
1323
+
1324
+ [source, sh]
1325
+ ----
1326
+ git clean -dfx
1327
+ ----
1328
+
1329
+
1330
+ == Modify most recent commit message
1331
+
1332
+ The git commit option `--amend` allows you to change the *most recent*
1333
+ commit message:
1334
+
1335
+ [source, sh]
1336
+ ----
1337
+ git commit --amend -m "New commit message"
1338
+ ----
1339
+
1340
+
1341
+ == Delete a Git tag
1342
+
1343
+ Use the git 'tag' command with the '-d' option
1344
+
1345
+ .from local
1346
+
1347
+ [source, sh]
1348
+ ----
1349
+ git tag -d v2023.3.0
1350
+ ----
1351
+
1352
+ .from remote
1353
+
1354
+ [source, sh]
1355
+ ----
1356
+ git push -d origin v2023.3.0
1357
+ ----
1358
+
1359
+
1360
+ == Set a Git tag
1361
+
1362
+ When modifying remember to issue a new tag command in git before committing,
1363
+ then push the new tag
1364
+
1365
+ [source, sh]
1366
+ ----
1367
+ git tag -a v2023.3.0 -m "v2023.3.0"
1368
+ git push origin --tags
1369
+ ----
1370
+
1371
+
1372
+ == Update Git Index (cache) completely
1373
+
1374
+ See: https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore
1375
+
1376
+ The series of commands below will remove all of the items from the Git
1377
+ Index (not from the working directory or local repo), and then updates
1378
+ the Git Index, while respecting git ignores.
1379
+
1380
+ NOTE: Index = Cache
1381
+
1382
+ [source, sh]
1383
+ ----
1384
+ git rm -r --cached . && git add .
1385
+ ----
1386
+
1387
+ or forced
1388
+
1389
+ [source, sh]
1390
+ ----
1391
+ git rm -rf --cached . && git add .
1392
+ ----
1393
+
1394
+ Then:
1395
+
1396
+ [source, sh]
1397
+ ----
1398
+ git commit -am "Cleanup files"
1399
+ git commit -am "New version 2023.3.0"
1400
+ git commit --allow-empty -m "New version 2023.3.0"
1401
+ git commit -am "Prepare new version 2023.3.0"
1402
+ git commit -am "Latest files of version 2023.3.0"
1403
+ ----
1404
+
1405
+
1406
+ == Add file permissions on Windows
1407
+
1408
+ See: https://medium.com/@akash1233/change-file-permissions-when-working-with-git-repos-on-windows-ea22e34d5cee
1409
+
1410
+ Most of the folks on Windows working with git repo’s use windows git bash
1411
+ for doing git check-ins and check-outs to/from from git repo…. if you are
1412
+ already not using it i will highly recommend use it… pretty neat tool
1413
+ for windows os.
1414
+
1415
+ [source, sh]
1416
+ ----
1417
+ git update-index --chmod=+x 'name-of-shell-script'
1418
+ ----
1419
+
1420
+
1421
+ == List all committed files
1422
+
1423
+ List all files in the repo, including those that are only staged but not
1424
+ yet committed:
1425
+
1426
+ [source, sh]
1427
+ ----
1428
+ git ls-files
1429
+ ----
1430
+
1431
+ Lists all of the *already* committed files being tracked by the repo:
1432
+
1433
+ [source, sh]
1434
+ ----
1435
+ git ls-tree --full-tree -r --name-only HEAD
1436
+ ----
1437
+
1438
+
1439
+ == Disable warning `CRLF will be replaced by LF`
1440
+
1441
+ You can turn off the warning with:
1442
+
1443
+ [source, sh]
1444
+ ----
1445
+ git config --global core.safecrlf false
1446
+ ----
1447
+
1448
+ NOTE: This will only turn off the warning, not the function itself.
1449
+
1450
+
1451
+ == Upload Gem to Gemfury
1452
+
1453
+ [source, sh]
1454
+ ----
1455
+ git remote add fury https://jekyll-one@git.fury.io/jekyll-one-org/<package-name>.git
1456
+ git push fury master
1457
+ ----
1458
+ ////