1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-11-02 07:18:29 +01:00
tldr/pages/common/git-mv.md

16 lines
362 B
Markdown
Raw Normal View History

2015-12-17 22:22:16 +01:00
# git mv
> Move or rename files and update the git index.
- Move file inside the repo and add the movement to the next commit:
2015-12-17 22:22:16 +01:00
`git mv {{path/to/file}} {{new/path/to/file}}`
- Rename file and add renaming to the next commit:
2015-12-17 22:22:16 +01:00
`git mv {{filename}} {{new_filename}}`
- Overwrite the file in the target path if it exists:
2015-12-17 22:22:16 +01:00
`git mv --force {{file}} {{target}}`