Delete github repository files locally

Sometimes, some things in our github repository are not needed, outdated or duplicated with other files, and we don't want it to take up space, then we need to delete it, but it seems that in the remote repository, there is no direct Removed functionality. Then, we need to delete from the local and submit the modification, how to do it?

The Happy folder has already been saved, and now we are going to delete it;

 1: First clone the remote warehouse to be deleted in the local warehouse;

                $ git clone [email protected]: Eternalzttz / learngit.git

2: cd into clone's warehouse

3. Perform the following operations on the files and folders that need to be deleted:

  If it is a file: git rm test.txt (delete file)

  If it is a folder: git rm -r test (remove folder)

  Here we are asking price folder, choose the second operation method:

               $ git rm -r Happy

3. Submit revisions

   $   git commit -m "Delete something."

4. Submit the changes to the xxx branch of the remote warehouse:

  $   git push origin xxx

 In general, the most common one we have is the master branch, so we can execute the command: $ git push origin master

 

ok You're done, let's refresh the remote repository and you can see that the Happy folder has been deleted.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324690365&siteId=291194637