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

Maverick Xiang 21 Reputation points
2022-01-22T12:08:24.643+00:00

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

Developer technologies Visual Studio Other
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Ken Tucker 5,861 Reputation points
    2022-01-22T12:21:47.207+00:00

    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
    2022-01-23T01:43:14.39+00:00

    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 31,056 Reputation points Microsoft External Staff
    2022-01-24T06:30:25.75+00:00

    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
    2022-01-24T15:24:08.063+00:00

    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
    2023-05-26T00:51:31.3133333+00:00

    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.