How to delete a file in a directory in a remote GitHub repository

                             How to delete a file in a directory in a remote GitHub repository

         A few days ago, I encountered a small problem when I used sourcetree to upload the project code to GitHub. Originally, the directory structure of the project has been created in the remote warehouse. I only need to transfer all the files in my local project folder directly to the corresponding directory of GitHub. Under the structure, you can directly access the index.html in the directory to see the interface.

    But I uploaded the entire project file to this directory, which is obviously wrong, but I can't find where to delete the uploaded project file on GitHub. After thinking about it for a long time, I finally came up with a solution:

  1. Create a folder locally that is the same as the remote directory. For example, if the remote directory structure is.../webui/project file, you can create a webui folder;
  2. Open the newly created webui folder in sourcetree, pull the files under the remote warehouse.../webui/ into the local webui folder, and delete the contents in the local webui folder;
  3. Then open the newly created webui folder in sourcetree, submit the content under the file, then go to github to see that the wrong project file uploaded before is gone;
  4. Finally, copy the files to be uploaded to the local webui folder, upload the code again, and you will have your own uploaded files in the corresponding directory structure on GitHub.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326882190&siteId=291194637