I try:
git mv a.py b.py src/
and get
fatal: multiple sources for the same target, source=b.py, destination=src/b.py
Using the -n flag, like so git mv -n a.py b.py src/
gives me:
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
Am I doing something really stupid? I'm using git version 1.6.6.1
To do this, click and hold your left mouse button on the top-left portion of where you want to start highlighting. Next, drag the box until the last file or folder is highlighted. Once the files are selected, they can be copied, cut, or dragged to another window to move them.
Right-click the file or folder you want, and from the menu that displays click Move or Copy. The Move or Copy window opens. Scroll down if necessary to find the destination folder you want. If you need to, click on any folder you see to access its subfolders.
I use bash loop:
for FILE in src/*.h; do git mv $FILE include/; done
This has been fixed in the current master branch of git, it's in v1.7.0-rc0 but not in a release build yet.
http://git.kernel.org/?p=git/git.git;a=commit;h=af82559b435aa2a18f38a4f47a93729c8dc543d3
In the mean time the simplest thing to do is to either git mv
the files individually or to just use mv
and then update the index manually, e.g. with git add -A
if you have appropriate .gitignore
patterns.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With