{"id":107,"date":"2024-04-27T22:54:42","date_gmt":"2024-04-27T20:54:42","guid":{"rendered":"https:\/\/blog.douwedevri.es\/?p=107"},"modified":"2025-02-18T21:02:23","modified_gmt":"2025-02-18T19:02:23","slug":"git","status":"publish","type":"post","link":"https:\/\/blog.dbdv.nl\/?p=107","title":{"rendered":"Git"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Create new branch<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>git checkout -b iss53<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is shorthand for:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git branch iss53\ngit checkout iss53<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Commit to the branch<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>git add .\ngit commit -m 'Create new footer &#91;issue 53]'<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Merge changes from main into branch<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>git checkout main<br>git pull<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>git checkout custom_branch<br>git merge main<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Merge branch into main (pull request)<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Create pull request on GitHub<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Revert changes<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>git rm --cached -r .\ngit reset --hard<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Remove file from repository but not locally<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>git rm --cached file.txt<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Create new branch This is shorthand for: Commit to the branch Merge changes from main into branch Merge branch into main (pull request) Create pull request on GitHub Revert changes Remove file from repository but not locally<\/p>\n","protected":false},"author":1,"featured_media":92,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-107","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=107"}],"version-history":[{"count":1,"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions"}],"predecessor-version":[{"id":108,"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions\/108"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=\/wp\/v2\/media\/92"}],"wp:attachment":[{"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}