git - 你如何在git中移动多个文件?

标签 git

我尝试:

git mv a.py b.py src/

得到

致命:同一目标的多个源,source=b.py,destination=src/b.py

使用 -n 标志,像这样 git mv -n a.py b.py src/ 给我:

Checking rename of 'a.py' to 'src/b.py'
Checking rename of 'b.py' to 'src/b.py'
fatal: multiple sources for the same target, source=b.py, destination=src/b.py

我是不是在做傻事?我正在使用 git 版本 1.6.6.1

最佳答案

我使用 bash 循环:

for FILE in src/*.h; do git mv $FILE include/; done

关于git - 你如何在git中移动多个文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2212857/

相关文章:

混帐克隆 : no address associated with name

xcode - 错误 : pathspec did not match any file(s) known to git

git - 只有一个子目录的Svn到Git

Gitlab 删除旧提交

git - 从 github 的特定分支使用 pip 安装包

git clone 挂起并超时

git - 如何将 Git 补丁应用于具有不同名称和路径的文件?

git - 在 git rebase 之后,我的本地分支和远程分支发生了分歧

Git-修改 .git refs 目录中的提交数据有什么危险

linux - ls 输出特定文件的颜色?