Questions tagged [git-mv]

git-mv is a git command that is used to move or rename a file, a directory, or a symlink

- Move or rename a file, a directory, or a symlink. The index is updated after successful completion, but the change must still be committed.

38 questions
0
votes
1 answer

Some files are not considered as "renamed" when moving them on git

I've one folder with ~300 files and ~30 folders. I did cut the folder(Ctrl+X) and pasted(Ctrl+V) on the expected folder. Then I only did a git add -A. After doing a git status, I would say that 95% of the files are correctly considered as "renamed",…
J4N
  • 19,480
  • 39
  • 187
  • 340
0
votes
1 answer

Are there any pitfalls when committing a file rename alone to keep history connected?

There are lots of questions on this site regarding the behavior of git mv and how to retrieve the history of a file across name boundaries. I understand that Git doesn't actually record the moving/renaming of a file, but I'm not entirely…
meltyhobo
  • 56
  • 3
0
votes
2 answers

mv or (git mv) multiple files, preserve extension

I have about 10 directories, each with contents that match this pattern: x.js x.d.ts x.ts and I want to rename these files to: index.js index.d.ts index.ts is there a mv or git mv command that I can use to rename the files? something like: git mv…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
0
votes
1 answer

merging branches after moving files to a different directory

I have two branches that I try to merge. In the original branch I have some files that in the 2nd branch where moved to a different location. the problem is that when I try to merge from the original branch, it doesn't apply the changes to the new…
ufk
  • 30,912
  • 70
  • 235
  • 386
0
votes
1 answer

git equivalent for rename

In bash I can do find . -name jndi.properties -exec rename 's/jndi/environment/' {} \; to recursively find all jndi.propertie files and have them renamed to environment.properties. But git status does not recognize the mv, it shows the deletion and…
dr jerry
  • 9,768
  • 24
  • 79
  • 122
0
votes
1 answer

git ls-tree HEAD returns nothing and git mv returns not under version control

I am using GIT under windows with the GIT Bash tool and was trying to move a file from one directory to the another. I tried different methods like clean, commit again etc. but everytime I got a reply while using git mv that the said file is not…
infoclogged
  • 3,641
  • 5
  • 32
  • 53
-2
votes
1 answer

How do you tell git that a delete and and add are really a move?

Most of the time, git can figure out when I've moved a file, but sometimes it can't. Is there a way to tell git, "trust me, this is a move?" A key component of this is that I am using a tool to rename the file. It would be annoying to have to revert…
Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356
-3
votes
2 answers

Why does 'git mv' not move a file? How to make it act "normally"?

Please forgive my ignorance here... Here's the background: I created a TestScritps directory to organize test scripts. I moved three scripts from to /TestScripts. I moved one at a time and performed a local commit after each…
jww
  • 97,681
  • 90
  • 411
  • 885
1 2
3