To move a repository in GitHub Desktop, you will need to move the local copy of the repository on your computer and then update the remote repository on GitHub to point to the new location. Here are the steps to do this:
- Open GitHub Desktop and navigate to the “Repositories” view.
- Right-click on the repository that you want to move, and then click on the “Open in Finder” (or “Open in Explorer” on Windows) to open the local folder of the repository in your computer’s file explorer.
- Close GitHub Desktop.
- Move the local folder of the repository to the new location on your computer using your file explorer.
- Open GitHub Desktop again and navigate to the “Repositories” view.
- Click on the repository that you have just moved, and then click on the “Remove” button.
- Confirm that you want to remove the repository by clicking on the “Remove” button in the confirmation dialog.
- Click on the “+” button on the top left corner and click on “Add” to open the local folder you moved the repository to.
- Click on the repository and click on the “Publish repository” button.
It’s important to note that by removing a repository from GitHub Desktop, you are only removing the local copy of the repository on your computer, and not the remote copy on GitHub. If you have made some commits or pushed some changes to the remote repository before moving it, you need to consider the consequences of removing the repository, it’s important to make a backup of the repository before moving it, and also to communicate with your collaborators if the repository is shared with others.
It’s also important to note that this process will create a new repository on GitHub and it will break any links to the previous repository, so you need to be careful when doing this.