gitgit-mv

How to move directory to another directory using git


I have one directory 'Checkout' that needs to move to the directory 'screens'. I do not want to overwrite the screens folder, I just want to add Checkout to it. This is all on local machine.

So far I have created and navigated to a new branch. The idea is to move the entire directory in this branch, add/commit the changes then push this branch with the changed directory location to remote.

I have tried this command...

git mv app/Checkout ... app/screens

but I get

fatal: bad source, source=..., destination=app/screens/...

What am I missing?


Solution

  • The command you want is git mv app/Checkout app/screens. The triple dots in the docs indicate that you can provide multiple source arguments, not literal dots.