{"id":1325,"date":"2024-01-09T17:53:27","date_gmt":"2024-01-09T12:23:27","guid":{"rendered":"https:\/\/www.openwriteup.com\/?page_id=1325"},"modified":"2024-04-02T08:39:01","modified_gmt":"2024-04-02T03:09:01","slug":"git-branch-lab","status":"publish","type":"page","link":"https:\/\/www.openwriteup.com\/?page_id=1325","title":{"rendered":"git branch lab"},"content":{"rendered":"<p><span style=\"text-decoration: underline;\"><strong>Youtube link:\u00a0<\/strong><\/span>\u00a0 <span style=\"color: #3366ff;\"><a style=\"color: #3366ff;\" href=\"https:\/\/www.youtube.com\/watch?v=m_uY2M9-9m0&amp;list=PLwO9EbabNLzsaHgP1dUCkdLg2CxZoPXGR&amp;index=3\">Navigation for labs<\/a><\/span><\/p>\n<p>Create a new branch name &#8220;test&#8221;<\/p>\n<pre>git branch test<\/pre>\n<p>Listing the branch<\/p>\n<pre>git branch<\/pre>\n<p>Checkout the branch<\/p>\n<pre>git checkout test<\/pre>\n<p>Listing the branch and adding commit the code<\/p>\n<pre>git branch\r\ntouch mycode\r\ngit add mycode\r\nls\r\ngit commit -m \"adding to test branch\"<\/pre>\n<p>Pushing code to branch<\/p>\n<pre>git push origin test<\/pre>\n<p>Merging and delete the branch<\/p>\n<pre>git checkout main\r\ngit merge test\r\ngit branch -d test\r\ngit push origin --delete test\r\ngit push origin main<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Youtube link:\u00a0\u00a0 Navigation for labs Create a new branch name &#8220;test&#8221; git branch test Listing the branch git branch Checkout the branch git checkout test Listing the branch and adding commit the code git branch touch mycode git add mycode ls git commit -m &#8220;adding to test branch&#8221; Pushing code to branch git push origin [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_oct_exclude_from_cache":false,"footnotes":""},"class_list":["post-1325","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/pages\/1325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1325"}],"version-history":[{"count":4,"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/pages\/1325\/revisions"}],"predecessor-version":[{"id":1402,"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/pages\/1325\/revisions\/1402"}],"wp:attachment":[{"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}