How To Remove Git Clone
When a user clones a Git repository from Github using the command git clone <url>, they get a copy of the remote repo on their local estimator so that they tin piece of work on information technology on their current working directory where the repo got cloned without directly making changes on the remote repository.
If you want to delete a local Github Repository that was cloned from to local estimator without touching or making any changes to the Remote GitHub repository then follow the commands beneath:
Step one: Go into your project file
cd <project_name>
rm -rf <repository_folder>.git
With the deletion of the '.git' file, this will delete the .git file that contains a log of the commit history, its information, and besides remote repository address from the working directory. We can think of this deletion equally when we do git init to initialize the current working directory as Git directory, with the to a higher place command we are but reverting it back to not being a Git directory.
Then what virtually the files and folder in the nowadays working directory?
This has to be deleted using the following gear up of command:
Step 2: (Optional if you desire to initialize working directory to another GitHub Repository Encounter Additional steps beneath):-
Get to the directory where the project is nowadays (Note: Don't go inside the project file).
rm -rf <folder_name>
What are rm and rf commands?
- In Linux, the user can delete/remove directories using rmdir or rm, in the above case we have made use of rm which is used to remove non-empty directories, different rmdir which is used to remove empty directories.
- This command is used to remove not-empty directories and all the files in the directory without beingness prompted if a directory or a file in the current working directory is write-protected (this case is very mutual when working on forked repository from GitHub) and the user is prompted to provide Y (for yes) to confirm the deletion of the write-protected file. Now using -rf with rm is effective as information technology can skip part of the user being prompted every time.
Additional Steps:
Suppose yous want to initialize (git init) a new Github repository, and and so add together it to a new remote repository and and so start calculation and committing to the files being added from the electric current working directory.
- Make certain that the current working directory is the directory that needs to be pushed to the open-source platform (GitHub).
- git init
- git remote add origin https://github.com/user/repo.git
- git push -u origin master
Deleting the Repository from GitHub Website
Step 1: Navigate to your project
https://github.com/your-github-username/Project-Proper name
Step 2: Go to the settings option on the superlative right corner like the image above, and navigate down to the danger zone
Step iii: Get and click on the delete this repository push and subsequently which you volition be prompted to brand sure you are deleting and all these action will permanently affect the repository, in the box type your-username/projection-proper name (supercede it with yours).
You lot may also be prompted to type in the GitHub countersign.
Following these steps will brand sure yous accept completely deleted the repository from the local PC as well as the GitHub site.
Here we are going to delete a particular file from our github using Github. This characteristic can be useful when we have by ,mistake added few files in our project but we no longer need that.
Deleting the File from GitHub Website
Pace 1: Navigate to your project
https://github.com/your-github-username/Projection-Name
Step 2 : Browse to the file in your repository that you want to delete.
At the top of the file, click on the Delete Icon.
Step 3: At the bottom of the page, type a brusk, meaningful commit message that describes the change you fabricated to the file
So information technology will show a alarm like this that the File successfully deleted.
How To Remove Git Clone,
Source: https://www.geeksforgeeks.org/deleting-a-local-github-repository/
Posted by: wongraycle65.blogspot.com
0 Response to "How To Remove Git Clone"
Post a Comment