{"absolute_url": "/jbmckee/force-push-branch/", "blog_post": false, "code": "git push -f <remote> <branch>\n\ne.g. git push -f origin master <-- Don't use master \n\nLeaving off <remote> and <branch> will force push all local branches that have set --set-upstream.", "created": "2020-11-09T12:34:58.113009", "description": "", "description_rendered": "", "embed_url": "https://snipt.net/embed/501243ea466193f664fac3097323f58c/", "full_absolute_url": "/jbmckee/force-push-branch/", "id": 113, "lexer": "text", "line_count": 5, "log_entries": [{"code": "git push -f <remote> <branch>\n(e.g. git push -f origin master). Leaving off <remote> and <branch> will force push all local branches that have set --set-upstream.", "created": "2020-11-09T12:34:58.241327", "diff": "--- \n+++ \n@@ -0,0 +1,2 @@\n+git push -f <remote> <branch>\n+(e.g. git push -f origin master). Leaving off <remote> and <branch> will force push all local branches that have set --set-upstream.", "user": "jbmckee"}, {"code": "git push -f <remote> <branch>\n\ne.g. git push -f origin master <-- Don't use master \n\nLeaving off <remote> and <branch> will force push all local branches that have set --set-upstream.", "created": "2020-11-09T12:36:11.769097", "diff": "--- \n+++ \n@@ -1,2 +1,5 @@\n git push -f <remote> <branch>\n-(e.g. git push -f origin master). Leaving off <remote> and <branch> will force push all local branches that have set --set-upstream.+\n+e.g. git push -f origin master <-- Don't use master \n+\n+Leaving off <remote> and <branch> will force push all local branches that have set --set-upstream.", "user": "jbmckee"}], "meta": "", "modified": "2026-04-27T01:00:44.596654", "publish_date": null, "raw_url": "/raw/501243ea466193f664fac3097323f58c/", "resource_uri": "/api/public/snipt/113/", "slug": "force-push-branch", "stylized": "<table class=\"highlighttable\"><tr><td class=\"linenos\"><div class=\"linenodiv\"><pre><a href=\"#L-1\">1</a>\n<a href=\"#L-2\">2</a>\n<a href=\"#L-3\">3</a>\n<a href=\"#L-4\">4</a>\n<a href=\"#L-5\">5</a></pre></div></td><td class=\"code\"><div class=\"highlight\"><pre><span></span><span id=\"L-1\"><a name=\"L-1\"></a>git push -f &lt;remote&gt; &lt;branch&gt;\n</span><span id=\"L-2\"><a name=\"L-2\"></a>\n</span><span id=\"L-3\"><a name=\"L-3\"></a>e.g. git push -f origin master &lt;-- Don&#39;t use master \n</span><span id=\"L-4\"><a name=\"L-4\"></a>\n</span><span id=\"L-5\"><a name=\"L-5\"></a>Leaving off &lt;remote&gt; and &lt;branch&gt; will force push all local branches that have set --set-upstream.\n</span></pre></div>\n</td></tr></table>", "tags": [{"absolute_url": "/public/tag/git/", "id": 17, "name": "git", "resource_uri": "/api/public/tag/17/", "snipts": "/api/public/snipt/?tag=17"}], "title": "Force push branch", "user": {"absolute_url": "/jbmckee/", "email_md5": "f4da96308b6db1b0b19738a7c105d3da", "id": 1, "resource_uri": "/api/public/user/1/", "snipts": "/api/public/snipt/?user=1", "snipts_count": 72, "username": "jbmckee"}}