(window.webpackJsonp=window.webpackJsonp||[]).push([[1146],{1554:function(a,e,t){"use strict";t.r(e);var r=t(31),n=Object(r.a)({},(function(){var a=this,e=a.$createElement,t=a._self._c||e;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"renaming"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#renaming"}},[a._v("#")]),a._v(" Renaming")]),a._v(" "),t("h2",{attrs:{id:"rename-folders"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rename-folders"}},[a._v("#")]),a._v(" Rename Folders")]),a._v(" "),t("p",[a._v("To rename a folder from "),t("code",[a._v("oldName")]),a._v(" to "),t("code",[a._v("newName")])]),a._v(" "),t("div",{staticClass:"language-git extra-class"},[t("pre",{pre:!0,attrs:{class:"language-git"}},[t("code",[a._v("git mv directoryToFolder/oldName directoryToFolder/newName\n\n")])])]),t("p",[a._v("Followed by "),t("code",[a._v("git commit")]),a._v(" and/or "),t("code",[a._v("git push")])]),a._v(" "),t("p",[a._v("If this error occurs:")]),a._v(" "),t("blockquote",[t("p",[a._v("fatal: renaming 'directoryToFolder/oldName' failed: Invalid argument")])]),a._v(" "),t("p",[a._v("Use the following command:")]),a._v(" "),t("div",{staticClass:"language-git extra-class"},[t("pre",{pre:!0,attrs:{class:"language-git"}},[t("code",[a._v("git mv directoryToFolder/oldName temp && git mv temp directoryToFolder/newName\n\n")])])]),t("h2",{attrs:{id:"renaming-a-local-branch"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#renaming-a-local-branch"}},[a._v("#")]),a._v(" Renaming a local branch")]),a._v(" "),t("p",[a._v("You can rename branch in local repository using this command:")]),a._v(" "),t("div",{staticClass:"language-git extra-class"},[t("pre",{pre:!0,attrs:{class:"language-git"}},[t("code",[a._v("git branch -m old_name new_name\n\n")])])]),t("h2",{attrs:{id:"rename-a-local-and-the-remote-branch"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rename-a-local-and-the-remote-branch"}},[a._v("#")]),a._v(" rename a local and the remote branch")]),a._v(" "),t("p",[a._v("the easiest way is to have the local branch checked out:")]),a._v(" "),t("div",{staticClass:"language-git extra-class"},[t("pre",{pre:!0,attrs:{class:"language-git"}},[t("code",[a._v("git checkout old_branch\n\n")])])]),t("p",[a._v("then rename the local branch, delete the old remote and set the new renamed branch as upstream:")]),a._v(" "),t("div",{staticClass:"language-git extra-class"},[t("pre",{pre:!0,attrs:{class:"language-git"}},[t("code",[a._v("git branch -m new_branch\ngit push origin :old_branch\ngit push --set-upstream origin new_branch\n\n")])])]),t("h4",{attrs:{id:"syntax"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#syntax"}},[a._v("#")]),a._v(" Syntax")]),a._v(" "),t("ul",[t("li",[t("code",[a._v("git mv ")])]),a._v(" "),t("li",[t("code",[a._v("git mv -f ")])])]),a._v(" "),t("h4",{attrs:{id:"parameters"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#parameters"}},[a._v("#")]),a._v(" Parameters")]),a._v(" "),t("table",[t("thead",[t("tr",[t("th",[a._v("Parameter")]),a._v(" "),t("th",[a._v("Details")])])]),a._v(" "),t("tbody",[t("tr",[t("td",[t("code",[a._v("-f")]),a._v(" or "),t("code",[a._v("--force")])]),a._v(" "),t("td",[a._v("Force renaming or moving of a file even if the target exists")])])])])])}),[],!1,null,null,null);e.default=n.exports}}]);