{"id":30,"date":"2015-07-30T17:56:30","date_gmt":"2015-07-30T15:56:30","guid":{"rendered":"https:\/\/www.aleskrejci.cz\/blog\/?p=30"},"modified":"2015-07-30T17:56:30","modified_gmt":"2015-07-30T15:56:30","slug":"git-problemy-s-koncem-radku","status":"publish","type":"post","link":"https:\/\/www.aleskrejci.cz\/blog\/2015\/07\/30\/git-problemy-s-koncem-radku\/","title":{"rendered":"Git &#8211; probl\u00e9my s koncem \u0159\u00e1dk\u016f"},"content":{"rendered":"<p>Pokud se V\u00e1m po <strong>push<\/strong>(nut\u00ed) k\u00f3du na github zm\u011bny v k\u00f3du projevuj\u00ed asi takto:<\/p>\n<pre class=\"brush: diff; title: ; notranslate\" title=\"\">\n-&lt;!DOCTYPE html&gt;\n-&lt;html lang=&quot;cs&quot;&gt;\n-    &lt;head&gt;\n-        &lt;meta charset=&quot;utf-8&quot;&gt;\n-    &lt;\/head&gt;\n-\n-    &lt;body&gt;\n-\n-        &lt;div id=&quot;nejakydiv&quot;&gt;\n-        &lt;\/div&gt;\n-\n-    &lt;\/body&gt;\n-&lt;\/html&gt;\n+&lt;!DOCTYPE html&gt;\n+&lt;html lang=&quot;cs&quot;&gt;\n+    &lt;head&gt;\n+        &lt;meta charset=&quot;utf-8&quot;&gt;\n+    &lt;\/head&gt;\n+\n+    &lt;body&gt;\n+\n+        &lt;div id=&quot;nejakydiv&quot;&gt;\n+            &lt;!-- Pridany dva radky --&gt;\n+            &lt;p&gt;Nejaky text&lt;\/p&gt;\n+        &lt;\/div&gt;\n+\n+    &lt;\/body&gt;\n+&lt;\/html&gt;\n<\/pre>\n<p>m\u00edsto (spr\u00e1vn\u011b) takto:<\/p>\n<pre class=\"brush: diff; title: ; notranslate\" title=\"\">\n&lt;html lang=&quot;cs&quot;&gt;\n    &lt;head&gt;\n        &lt;meta charset=&quot;utf-8&quot;&gt;\n    &lt;\/head&gt;\n\n    &lt;body&gt;\n\n        &lt;div id=&quot;nejakydiv&quot;&gt;\n+            &lt;!-- Pridany dva radky --&gt;\n+            &lt;p&gt;Nejaky text&lt;\/p&gt;\n        &lt;\/div&gt;\n\n    &lt;\/body&gt;\n&lt;\/html&gt;\n<\/pre>\n<p>Z\u0159ejm\u011b jeden program\u00e1tor m\u00e1 nastaven\u00e9 znaky pro koncov\u00e9 \u0159\u00e1dky jako LF (linux) a druh\u00fd CRLF (windows). Nejvhodn\u011bj\u0161\u00ed v r\u00e1mci t\u00fdmu je v\u017edy se domluvit.<\/p>\n<p>Pro automatick\u00fd p\u0159evod na crlf <em>(windows zakon\u010den\u00ed \u0159\u00e1dk\u016f) <\/em>prove\u010fte\u00a0p\u0159\u00edkaz:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ngit config --global core.autocrlf true\n<\/pre>\n<p>Viz:\u00a0<a href=\"https:\/\/help.github.com\/articles\/dealing-with-line-endings\">https:\/\/help.github.com\/articles\/dealing-with-line-endings<\/a><\/p>\n<p>Toto nastaven\u00ed m\u016f\u017eete tak\u00e9 editovat ru\u010dn\u011b v:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n%USERPROFILE%\/.gitconfig\n<\/pre>\n<p><strong>.gitconfig<\/strong> by pak m\u011bl vypadat n\u011bjak takto:<\/p>\n<pre class=\"brush: bash; highlight: [4,5]; title: ; notranslate\" title=\"\">\n&#x5B;user]\n\temail = vas@email.tld\n\tname = Jmeno prijmeni\n&#x5B;core]\n\tautocrlf = true\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Pokud se V\u00e1m po push(nut\u00ed) k\u00f3du na github zm\u011bny v k\u00f3du projevuj\u00ed asi takto: -&lt;!DOCTYPE html&gt; -&lt;html lang=&quot;cs&quot;&gt; &#8211; &lt;head&gt; &#8211; &lt;meta charset=&quot;utf-8&quot;&gt; &#8211; &lt;\/head&gt; &#8211; &#8211; &lt;body&gt; &#8211; &#8211; &lt;div id=&quot;nejakydiv&quot;&gt; &#8211; &lt;\/div&gt; &#8211; &#8211; &lt;\/body&gt; -&lt;\/html&gt; +&lt;!DOCTYPE html&gt; +&lt;html lang=&quot;cs&quot;&gt; + &lt;head&gt; + &lt;meta charset=&quot;utf-8&quot;&gt; + &lt;\/head&gt; + + &lt;body&gt; + + &lt;div [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[13,14],"class_list":["post-30","post","type-post","status-publish","format-standard","hentry","category-windows","tag-git","tag-line-endings"],"_links":{"self":[{"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/posts\/30","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/comments?post=30"}],"version-history":[{"count":0,"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/posts\/30\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/media?parent=30"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/categories?post=30"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/tags?post=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}