Help Topic: The Git Move Command


Maintained by: oviquezr@mit.edu         Get PDF


The Git mv Command


The git mv command allows you to change the name of a file or directory in a locally checked out repository while retaining the history of the file or directory. More info on git mv can always be found by Googling "Git book" and reading the full PDF online free, or just typing git help mv anytime on the command line.

Basic usage of the git mv command    [top]


The basic syntax for the git mv command is:

  $ git mv alpha.cpp bravo.cpp
  On branch master
  Your branch is up to date with 'origin/master'.

  Changes to be committed:
    (use "git restore --staged <file>..." to unstage)
      renamed:    alpha.cpp -> bravo.cpp

The git mv command does not require a network connection to the server and only declares an intention to make a set of changes to the master copy on the Git server upon the next commit.


Page built from LaTeX source using texwiki, developed at MIT. Errata to issues@moos-ivp.org. Get PDF