Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 吉特:更改主分支?_Git - Fatal编程技术网

Git 吉特:更改主分支?

Git 吉特:更改主分支?,git,Git,假设我有这些git分支: master branchone 我想这样做,保持所有历史完整: master -> oldmaster branchone -> master 您可以使用git branch-m git branch -m master tmpbranch git branch -m branchone master git branch -m tmpbranch branchone

假设我有这些git分支:

master
branchone
我想这样做,保持所有历史完整:

master -> oldmaster
branchone -> master

您可以使用
git branch-m

git branch -m master tmpbranch
git branch -m branchone master
git branch -m tmpbranch branchone