1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 15:02:09 +02:00
tldr/pages/common/git-mv.md
2021-01-08 13:09:54 +00:00

16 lines
417 B
Markdown

# git mv
> Move or rename files and update the Git index.
> More information: <https://git-scm.com/docs/git-mv>.
- Move file inside the repo and add the movement to the next commit:
`git mv {{path/to/file}} {{new/path/to/file}}`
- Rename file and add renaming to the next commit:
`git mv {{filename}} {{new_filename}}`
- Overwrite the file in the target path if it exists:
`git mv --force {{file}} {{target}}`