How to rename a git repository? -


git mv renames file or directory in repository. how rename git repository itself?

there various possible interpretations of meant renaming git repository: displayed name, repository directory, or remote repository name. each requires different steps rename.

displayed name

rename displayed name (e.g., shown gitweb):

  1. edit .git/description contain repository's name.
  2. save file.

repository directory

git not reference name of directory containing repository, used git clone master child, can rename it:

  1. open command prompt (or file manager window).
  2. change directory contains repository directory (i.e., not go repository directory itself).
  3. rename directory (e.g., using mv command line or f2 hotkey gui).

remote repository

rename remote repository follows:

  1. go remote host (e.g., https://github.com/user/project).
  2. follow host's instructions rename project (will differ host host, settings starting point).
  3. go local repository directory (i.e., open command prompt , change repository's directory).
  4. determine new url (e.g., git@github.com:user/project-new.git)
  5. set new url using git:

    git remote set-url origin git@github.com:user/project-new.git 

Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -