【发布时间】:2019-06-28 00:35:10
【问题描述】:
我在当前名为“foo”的分支中进行了一些更改。
我想从当前分支创建一个名为“bar”的新分支。
但新分支不应包含我当前分支中的任何更改(我本地系统中的已提交更改)。
例子
$ git clone ssh://svc@somerepo.git
$ cd somerepo
$ ls
test1 test2 test3
$ cat test1 test2 test3
< no output, all these 3 files are empty >
$ echo "testing" >> test1
$ git commit -am "test"
现在我需要从当前分支创建一个名为 new-branch 的新分支,该分支不应包含任何更改 - 例如“测试”提交的更改(意味着所有上述 3 个文本文件都不包含任何内容)并推送到远程。
我们有什么办法吗?
【问题讨论】: