这是做什么的:git branch -f [英] What does this do: git branch -f
本文介绍了这是做什么的:git branch -f的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试弄清楚如何正确使用此命令。我相信这是命令和标志,我实际上想将一个分支变成另一个分支(基本上删除一个分支,并使用与另一个分支的文件相同的名称创建一个新分支),但是我不确定,
I'm trying to figure out how to use this command properly. I believe this is the command and flag I want to essentially make one branch into my other branch (basically delete a branch and create a new branch with the same name with the files of another branch), but I don't know for sure, or if I have the syntax correct.
如果我这样做:
git branch -f master sub-branch
它将从master删除所有文件并填充
Will it remove all of the files from master and fill it with the files from sub-branch?
推荐答案
-f
参数代表-force
。
- 如果分支称为
master
已经存在,除非您使用-f
,否则git将不允许您覆盖它。 - 第二个参数(
子分支
)将用于确定master
分支的位置HEAD
应该指向。
- If a branch called
master
already exists, git will not allow you to overwrite it, unless you use-f
. - Second parameter (
sub-branch
) will be used to determine where themaster
branch'sHEAD
should be pointing to.
这篇关于这是做什么的:git branch -f的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文