Question

I'm trying to search on the web a way to rename all the files in a directory and move all the contents of that directory one level up inside another directory using git.

For example, replace "run" with ruin"

Directory a/b/c contains:
run1.txt
run2.txt
runner.txt
file.txt

Result: 
Directory a/d/ contains:
ruin1.txt
ruin2.txt
ruiner.txt
file.txt
Was it helpful?

Solution

If you do move the files yourself (without git), then you would need a:

git add -A

That way, git will detect the changes. See "What's the difference between git add . and git add -u?": git will detect the additions and the deletions, and deduce from it the moves.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top