![]() |
Changing the root folder of your Git repository involves moving the .git directory to a new location and ensuring that your project’s files are in the correct structure relative to this new root. To change the root folder of your Git repository, you essentially need to move the .git directory to the desired new root location. Here are the steps to do this: Method 1: Moving the Repository to a New Root FolderMove the .git directory from the current root folder to the new root folder. cd GFG ![]() Before Moving .git Folder ![]() After Moving the .git folder Method 2: Using a New Repository InitializationStep 1: Create a new repository![]() Navigate to your new root folder and initialize a new Git repository. cd GFG1 Step 2: Add your files and commitAdd your existing files to this new repository. git add . Step 3: Link to the remote repositoryIf you have a remote repository (like on GitHub or GitLab), you need to add it to your new repository. git remote add origin https://github.com/bishal1289/Hello__World.git ![]() How To Change The Root Folder Of Your Git Repo? |
Reffered: https://www.geeksforgeeks.org
Git |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 23 |