{"id":28,"date":"2018-03-22T12:30:38","date_gmt":"2018-03-22T17:30:38","guid":{"rendered":"http:\/\/www.jmjatlanta.com\/?p=28"},"modified":"2018-05-28T07:10:00","modified_gmt":"2018-05-28T12:10:00","slug":"git-tricks","status":"publish","type":"post","link":"https:\/\/www.jmjatlanta.com\/index.php\/2018\/03\/22\/git-tricks\/","title":{"rendered":"Git Tricks"},"content":{"rendered":"<p>Here are some tricks that I use. They&#8217;re here because I need a place to quickly refer to them.<\/p>\n<ul>\n<li>Updating a fork with upstream changes:\n<ul>\n<li>Reference: <a href=\"https:\/\/help.github.com\/articles\/syncing-a-fork\/\">https:\/\/help.github.com\/articles\/syncing-a-fork\/<\/a><\/li>\n<li>git fetch upstream<\/li>\n<li>git checkout master<\/li>\n<li>git merge upstream\/master<\/li>\n<\/ul>\n<\/li>\n<li>Interactive rebasing:\n<ul>\n<li>git rebase -i &lt;branch&gt;<\/li>\n<\/ul>\n<\/li>\n<li>To avoid messing up a PR, you can do things like:\n<ul>\n<li>git reset &#8211;hard HEAD-1 # or HEAD-2, etc, or directly to a commit hash<\/li>\n<li>git push &#8211;force origin branch_name<\/li>\n<\/ul>\n<\/li>\n<li>Always do a backup before reset or rebase<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Here are some tricks that I use. They&#8217;re here because I need a place to quickly refer to them. Updating a fork with upstream changes: Reference: https:\/\/help.github.com\/articles\/syncing-a-fork\/ git fetch upstream git checkout master git merge upstream\/master Interactive rebasing: git rebase -i &lt;branch&gt; To avoid messing up a PR, you can do things like: git reset [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/comments?post=28"}],"version-history":[{"count":4,"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":36,"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/posts\/28\/revisions\/36"}],"wp:attachment":[{"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/media?parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/categories?post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/tags?post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}