💡
原文英文,约100词,阅读约需1分钟。
📝
内容提要
使用命令`git checkout <branch> -- path/to/file`可以将文件从一个分支复制到另一个分支。首先切换到主分支,然后创建并切换到新分支,最后导入所需文件。
🎯
关键要点
-
使用命令`git checkout <branch> -- path/to/file`可以将文件从一个分支复制到另一个分支。
-
首先切换到主分支,使用命令`git checkout main`。
-
然后创建并切换到新分支,使用命令`git checkout -b branch-B`。
-
最后导入所需文件到新分支,使用命令`git checkout branch-A -- path/to/file`。
➡️