Share via

How to modify the local repository location in the Git in Visual Studio.

Maverick Xiang 21 Reputation points
Jan 22, 2022, 12:08 PM

I use Visual Studio 2022. This is the first time I use Git.
I create the repository. The local repository path is set. I hope to change the path, but it can not be changed.
167433-%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2022-01-22-195446.jpg

I check the Git setting, but still do not know the way to modify the path
167395-%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2022-01-22-195840.jpg

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,338 questions
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Ken Tucker 5,856 Reputation points
    Jan 22, 2022, 12:21 PM

    I am not sure what you are asking. The git repository location is in the folder the project is in

    0 comments No comments

  2. Maverick Xiang 21 Reputation points
    Jan 23, 2022, 1:43 AM

    I can not modify the existing local Git repository location. It can not be edit
    167420-%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2022-01-22-195446.jpg

    167448-%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2022-01-22-195840.jpg

    0 comments No comments

  3. Anna Xiu-MSFT 30,556 Reputation points Microsoft Vendor
    Jan 24, 2022, 6:30 AM

    Hi @Maverick Xiang ,

    Welcome to Microsoft Q&A!

    If you want to modify the local path of the existing local Git repository, you can try to clone a repo in Visual Studio and change to a different location in the Path section.
    167673-image.png

    Sincerely,
    Anna
    *
    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  4. Maverick Xiang 21 Reputation points
    Jan 24, 2022, 3:24 PM

    The clone repository action is conducted
    167860-%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2022-01-24-231619.jpg

    The old repository (D:) does not disappear.
    167927-%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2022-01-24-232246.jpg

    How to use the new repository (D:\Git) to replace the older one (D:)


  5. Ben Sippel 0 Reputation points
    May 26, 2023, 12:51 AM

    Delete the .git folder from the repository path you wish to remove.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.