-
Notifications
You must be signed in to change notification settings - Fork 890
git mv
DorloBorlo edited this page Dec 8, 2023
·
4 revisions
The following examples assume you already have a repository in place to work with. If not, see git-init.
Move a file to a new location.
$ git mv <file> <new/path>
using (var repo = new Repository("<repoPath>"))
{
// Moves the file. Path must be in Posix format (using '/' as path separator)
Commands.Move(repo, "<file>", "<new/path>")
}
Rename a file.
$ git mv <file> <path/to/file>/<newname>
using (var repo = new Repository("<repoPath>"))
{
// Renames the file. Path must be in Posix format (using '/' as path separator)
Commands.Move(repo, "<file>", "<path/to/file>/<newname>")
}