将项目从默认分支推送到其他分支

时间:2021-07-09 10:34:29

标签: github

我有一个包含 3 个分支(main、branch1、branch2)的存储库。

main 是默认分支。

在主要我有一个项目,在分支 1 和 2 中我有一个空的。

我想将 main 中的项目复制到其他 2 个分支。

怎么做?

1 个答案:

答案 0 :(得分:0)

git checkout main
git checkout branch1 .  #copies the contents of main into working directory
git commit -am "Making branch1 match main"

对 branch2 做同样的事情

相关问题