Home> Development Tools> git> body text

How to delete a repository from a remote Git repository

PHPz
Release: 2023-04-03 09:52:28
Original
1700 people have browsed it

Git remote warehouse deletion refers to deleting an existing warehouse from the remote Git warehouse. After you delete a remote repository, the repository will no longer exist unless you clone it from another repository.

This article will introduce how to delete a repository from a remote Git repository.

Step 1: Find the URL of the repository you want to delete

On Github, click the name of the repository and then click the "Settings" button in the upper right corner of the page. Then, in the left menu of the warehouse settings page, click the Warehouse option. You will see the URL of the repository, such as: git@github.com:USERNAME/REPO.git.

Step 2: Remove the reference to the remote repository from the local repository

To remove the association with the remote repository from the local Git repository, use the following command:

git remote rm 
Copy after login

" remote_name" is the reference name to the remote repository. In the above example, the remote name of the GIT repository is "origin":

git remote rm origin
Copy after login

Step 3: Delete the repository in the remote repository

On Github, click the name of the repository, then Click the "Settings" button on the right side of the page. Then select the "Delete Warehouse" option in the left menu. Please note that this option will permanently delete the repository, so consider this carefully.

Step 4: Confirm deletion

When deleting a remote repository on Github, you will be asked to enter the confirmation password for this operation. To ensure that the deletion was intentional, please enter your password again.

Here are some typical tips that you have successfully deleted the remote repository:

Unsetting upstream Deleted (was f4e3adc)
Copy after login

After deleting the remote repository, your workspace will not be affected because the local Git repository still exists . If you don't need your local Git repository, you can delete it.

Summary

This article describes how to delete a repository from a remote Git repository. To do this, use the "git remote rm" command to remove the reference to the remote repository from your local Git repository. Afterwards, you must delete the repository on Github to permanently delete it. Deleting the remote Git repository should be carefully considered because this operation is irreversible and will permanently delete the Git repository and all its history, files, branches, etc.

The above is the detailed content of How to delete a repository from a remote Git repository. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!