Как удалить проект в github
Перейти к содержимому

Как удалить проект в github

  • автор:

Deleting a repository

You can delete any repository or fork if you’re either an organization owner or have admin permissions for the repository or fork. Deleting a forked repository does not delete the upstream repository.

Only members with owner privileges for an organization or admin privileges for a repository can delete an organization repository. If Allow members to delete or transfer repositories for this organization has been disabled, only organization owners can delete organization repositories. For more information, see «Repository roles for an organization.»

Deleting a public repository will not delete any forks of the repository.

Warnings:

  • Deleting a repository will permanently delete release attachments and team permissions. This action cannot be undone.
  • Deleting a private repository will delete all forks of the repository.

Some deleted repositories can be restored within 90 days of deletion. For more information, see «Restoring a deleted repository.»

On GitHub.com, navigate to the main page of the repository.

Under your repository name, click

Settings. If you cannot see the «Settings» tab, select the

dropdown menu, then click Settings.

Screenshot of a repository header showing the tabs. The "Settings" tab is highlighted by a dark orange outline.

Under Danger Zone, click Delete this repository.

Repository deletion button

Read the warnings.

To verify that you’re deleting the correct repository, type the name of the repository you want to delete.

Deletion labeling

Click I understand the consequences, delete this repository.

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

GitHub delete repository the RIGHT way [Step-by-Step]

navigate to the directory hosting the repo and run this command to Github delete repository on your command line.

The last step is to head over to the Github website and follow these to delete the target repository.

  1. Access the main page of the target repo.
  2. Click Settings on the navigation menu
  3. Scroll down until you see Danger Zone
  4. Click on Delete this repository
  5. Type the repo name and accept the warnings

The above are typical routes to Github delete repository. What if you want to explore the nitty-gritty of deleting the Github repository?

That is why it would help to find practical ways to Github delete repository by following this tutorial to the end. Let us get started.

Lab setup to practice Github delete repository

We will imitate a typical development environment where you create a repo, clone it, make commits and push the changes to Github. We will then assume we no longer need the repo and delete it on the command line and Github.com.

I am creating a repo called github_delete_repo on Github.

GitHub delete repository the RIGHT way [Step-by-Step]

Copy the repo URL.

GitHub delete repository the RIGHT way [Step-by-Step]

Clone it on the command line.

GitHub delete repository the RIGHT way [Step-by-Step]

Let us build the repo locally before seeing examples of the Github delete repository.

We currently have one commit history and a README.md file.

GitHub delete repository the RIGHT way [Step-by-Step]

Let us create more files.

Stage the files

and commit them.

Repeat the process to create the third commit history.

Create two more files

Let us check the commit history.

We have three commits in the history.

GitHub delete repository the RIGHT way [Step-by-Step]

Now that we have an active repo with some commits to practice the Github delete repository, let us apply the setup to the command line before remote repo deletion.

Github delete repository using the command line

Github delete repository on the command line starts by identifying the location of the target repo. For that reason, it would help to understand how a repository exists on your computer before deleting it.

How Github repository resides on your computer

Initializing a repository on any directory creates a .git sub-directory on your computer. .git sub-directory has all the information about the tracked project, such as commits, commit objects and commit history.

The sub-directory is hidden on both command line or GUI by default. To see the folder on the command line or terminal, run the ls command with the -a flag, as follows:

or align the files and directories vertically by adding the -l flag.

GitHub delete repository the RIGHT way [Step-by-Step]

The limit of interacting with instantiated repo depends on the git init flag used. For instance, instantiating an empty repo without a flag allows you to create a file, stage, and commit changes to the repo.

On the other hand, most flags like —bare only allow you to do push or pull requests to the repo. This is because you lack a working directory to add changes or do commits. Here is brief information about standard git init flags:

Common flags determining interaction with the local git repository

The —bare flag enables you to handle push and pull requests only. You can neither add nor commit to the repo.

Running the command

makes git to ignore on the working directory when initializing the repo. The tracked files reside in the <project.git> folder.

template

The —template flag is crucial when creating a reference directory. Like the unflagged repo, the —template flag:

git init —template=<template_directory>

creates a repo with a .git subdirectory, enabling you to copy files.

separate

Instantiating a repo with the —separate flag:

creates a text file with the path to the target directory.

quiet

The —quiet flag allows you to only interact with the most critical messages, errors, and errors. You can either use

to instantiate a quiet repo.

shared

With the —shared flag

you can specify user permissions for pushing or pulling changes to the repo. Examples of permissions to configure are TRUE, FALSE, GROUP, ALL, or EVERYBODY.

Now that you know how the repo resides on your computer, let us see two typical ways to delete it on the command line.

Delete the root directory

This is a dangerous route to take when doing Github delete repository on the command line because you cannot recover any files after the action.

Think of the .git sub-directory as a room within a house. One way to destroy the room is to damage the entire house. In our case, we can create and delete a repository by removing the directory containing the .git sub-directory.

Let us get out of the cloned Github repo.

and create another repo

then initialize it

Listing all files

shows we have a .git sub-directory.

GitHub delete repository the RIGHT way [Step-by-Step]

Let us return to the root directory

before deleting the target folder using the -rf flag, as follows:

Both repo and directory are gone!

Delete only the git sub-directory

Sometimes you need to delete a Github repo on the terminal or command line without clearing the files. Let us follow these steps to achieve that.

Navigate to the directory containing the .git sub-directory.

Check repo presence:

then run the following command to Github delete repository locally.

where rm stands for remove, -r means recursively removing the target files whose directory we have specified, whereas the -f flag means overriding every change till the up-to-date check.

Recheck the repository.

github delete repo on command line

The local version of the Github repository got deleted.

Method-2: Github delete repository from the website

Deleting a repo on the Github website is pretty straightforward. Follow these steps to achieve that.

Step-1. Move to github.com

Click the Sign in tab to access to your Github account.

GitHub delete repository the RIGHT way [Step-by-Step]

GitHub delete repository the RIGHT way [Step-by-Step]

You get to the Sign in page, permitting you to view all your repos.

Let us find the github_delete_repo repo we created earlier among the list of repos.

Step-2. Access the main page of the target repo

Click on the target repo. We land on a repo’s page appearing, as follows:

GitHub delete repository the RIGHT way [Step-by-Step]

Step-3. Click Settings on the navigation menu

GitHub delete repository the RIGHT way [Step-by-Step]

Click the highlighted Settings tab, as shown here.

Step-4. Scroll down until you see Danger Zone

You should the Change repository visibility, Transfer ownership, Archive this repository, and Delete this repository buttons.

GitHub delete repository the RIGHT way [Step-by-Step]

Step-5. Click on Delete this repository

GitHub delete repository the RIGHT way [Step-by-Step]

Step-6. Type the repo name and accept the warnings

Let us copy and paste the repo name, Stevealila/github_delete_repo , above the input box or type each letter until the box named I understand the consequences, delete this repository becomes active.

GitHub delete repository the RIGHT way [Step-by-Step]

Github redirects us to the main page with a success message, Your repository «Stevealila/github_delete_repo» was successfully deleted.

Conclusion

You can Github delete repository by discarding a directory containing the repo, removing the .git sub-directory on the command line, or following the steps outlined in this tutorial to delete the repo on the Github website.

Didn’t find what you were looking for? Perform a quick search across GoLinuxCloud

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can either use the comments section or contact me form.

Случайно форкнул проект в GitHub, как теперь его удалить?

Случайно форкнул проект в GitHub. Проект x64dbg. Удалил у себя все файлы, но каталог master x64dbg остался.

Как от него избавиться? И желательно от истории тоже.

Kromster's user avatar

Форк — это самостоятельный репозиторий на GitHub, он создается для того, чтобы вы могли продолжить работу над проектом, сохранили всю историю изменений до форка и могли делать пулл-реквесты.

Если вам нужно только получить последнюю версию проекта, то форк для этого не нужен. Можно клонировать «родительский» репозиторий, причём достаточно будет неполного (неглубокого) клонирования.

Чтобы полностью удалить любой проект на GitHub (не обязательно форк):

Закрытие и удаление projects

Сведения о закрытии, повторном открытии и окончательном удалении проект.

Проект можно удалить без возможности восстановления.

  1. Перейдите к своему проекту
  2. В правом верхнем углу щелкните

, чтобы открыть меню.

Снимок экрана: значок меню

Параметры для доступа к параметрам проекта.

Снимок экрана: пункт меню "Параметры"

Снимок экрана: подтверждение удаления проекта

Вы можете закрыть проект, чтобы удалить его из списка проектов, но сохранить содержимое и возможность повторно открыть проект позже.

  1. Перейдите к своему проекту
  2. В правом верхнем углу щелкните

, чтобы открыть меню.

Снимок экрана: значок меню

Параметры для доступа к параметрам проекта.

Снимок экрана: пункт меню "Параметры"

Повторное открытие проекта организации

Вы можете повторно открыть ранее закрытый проект.

В правом верхнем углу GitHub.com щелкните фотографию профиля, а затем щелкните Ваши организации.

Снимок экрана: раскрывающееся меню под @octocatизображением профиля. "Ваши организации" выделены темно-оранжевым цветом.

2. Щелкните название своей организации.

Название организации в списке организаций

1. Перейдите на вкладку Проекты.

Снимок экрана: кнопка закрытия проекта

Чтобы отобразить закрытые проекты, щелкните Закрытые.

Снимок экрана: кнопка закрытия проекта

Щелкните проект, который необходимо открыть повторно.

В правом верхнем углу щелкните

, чтобы открыть меню.

Снимок экрана: значок меню

В меню щелкните

Параметры для доступа к параметрам проекта.

Снимок экрана: пункт меню "Параметры"

В нижней части страницы выберите Повторно открыть проект.

Повторное открытие проекта пользователя

Вы можете повторно открыть ранее закрытый проект.

В правом верхнем углу GitHub.com щелкните фотографию профиля, а затем щелкните Ваш профиль.

1. Перейдите на вкладку Проекты.

Снимок экрана: кнопка закрытия проекта

Чтобы отобразить закрытые проекты, щелкните Закрытые.

Снимок экрана: кнопка закрытия проекта

Щелкните проект, который необходимо открыть повторно.

В правом верхнем углу щелкните

, чтобы открыть меню.

Снимок экрана: значок меню

В меню щелкните

Параметры для доступа к параметрам проекта.

Снимок экрана: пункт меню "Параметры"

В нижней части страницы выберите Повторно открыть проект.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *