mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-08-07 01:15:41 +02:00
commit
5992933590
1 changed files with 15 additions and 0 deletions
15
pages/common/git-mv.md
Normal file
15
pages/common/git-mv.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# git mv
|
||||||
|
|
||||||
|
> Move or rename files and update the git index.
|
||||||
|
|
||||||
|
- 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}}`
|
Loading…
Add table
Reference in a new issue