Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in DevOps and Agile by (19.4k points)
edited by

I think it should work to copy the directory to be renamed to a new directory with desired name, and delete the old directory, and git add git commit and push everything. But is this the best way?

1 Answer

0 votes
by (27.5k points)

This command should do the magic:

$ git mv <old name> <new name>

Additional info, case sensitive renaming —eg. from newname to NewName:

Follow these steps:

$ git mv newname tmp

$ git mv tmp NewName

Remember this has to be followed by commit and push.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...