{"id":1320,"date":"2025-02-21T15:31:40","date_gmt":"2025-02-21T15:31:40","guid":{"rendered":"https:\/\/blog.faktor0.de\/?p=1320"},"modified":"2025-03-04T08:51:32","modified_gmt":"2025-03-04T08:51:32","slug":"git-rebase-tipps","status":"publish","type":"post","link":"https:\/\/blog.faktor0.de\/?p=1320","title":{"rendered":"Git Rebase Tipps"},"content":{"rendered":"<p><strong>Beim Rebase f\u00fcr jede Datei entscheinden, ob <em>ours<\/em> oder <em>theirs<\/em> genommen werden soll:<\/strong><\/p>\n<p><code>git checkout --ours -- [paths]<\/code><br \/>\noder<br \/>\n<code>git checkout --theirs -- [paths]<\/code><br \/>\nAnschlie\u00dfend mit <code>git add [path]<\/code> die Datei hinzuf\u00fcgen und mit <code>git rebase --continue <\/code>den rebase fortsetzen<\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/16825849\/choose-git-merge-strategy-for-specific-files-ours-mine-theirs\">https:\/\/stackoverflow.com\/questions\/16825849\/choose-git-merge-strategy-for-specific-files-ours-mine-theirs<\/a><\/p>\n<p><strong>Alte Commits l\u00f6schen durch Rebase:<\/strong><br \/>\nHead um vier commits zur\u00fccksetzen:<br \/>\n<code>git rebase -i HEAD~4<\/code><\/p>\n<p>Dann mit pick die Commits w\u00e4hlen, die man behalten will:<br \/>\n<code>pick 2f05aba ... #will be preserved<br \/>\n#pick 3371cec ... #will be deleted<br \/>\n#pick daed25c ... #will be deleted<br \/>\npick e2b2a84 ... #will be preserved<\/code><\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/9725156\/remove-old-git-commits\">https:\/\/stackoverflow.com\/questions\/9725156\/remove-old-git-commits<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Beim Rebase f\u00fcr jede Datei entscheinden, ob ours oder theirs genommen werden soll: git checkout &#8211;ours &#8212; [paths] oder git checkout &#8211;theirs &#8212; [paths] Anschlie\u00dfend mit git add [path] die Datei hinzuf\u00fcgen und mit git rebase &#8211;continue den rebase fortsetzen https:\/\/stackoverflow.com\/questions\/16825849\/choose-git-merge-strategy-for-specific-files-ours-mine-theirs Alte Commits l\u00f6schen durch Rebase: Head um vier commits zur\u00fccksetzen: git rebase -i HEAD~4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,32],"tags":[],"class_list":["post-1320","post","type-post","status-publish","format-standard","hentry","category-git","category-git-2"],"_links":{"self":[{"href":"https:\/\/blog.faktor0.de\/index.php?rest_route=\/wp\/v2\/posts\/1320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.faktor0.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.faktor0.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.faktor0.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.faktor0.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1320"}],"version-history":[{"count":5,"href":"https:\/\/blog.faktor0.de\/index.php?rest_route=\/wp\/v2\/posts\/1320\/revisions"}],"predecessor-version":[{"id":1328,"href":"https:\/\/blog.faktor0.de\/index.php?rest_route=\/wp\/v2\/posts\/1320\/revisions\/1328"}],"wp:attachment":[{"href":"https:\/\/blog.faktor0.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.faktor0.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.faktor0.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}