Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一直在尝试从备用 git 分支中获取文件,并以新的指定名称将文件复制到当前分支。
我找到了如何使用此处git checkout source_branch <paths>指定的方法将文件从备用分支复制到当前分支,但我无法确定如何指定新文件名?
git checkout source_branch <paths>
您可以使用命令git show commitish:path > newpath。这里commitish可以像往常一样是一个分支名称。
git show commitish:path > newpath
commitish