Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Git deletes remote server files while keeping local files

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how Git deletes remote server files while keeping local files. I hope you will get something after reading this article. Let's discuss it together.

How Git deletes remote server files while keeping local files

When uploading a project to git, sometimes some local eclipse configuration files will be uploaded to the server, so it is obviously unreasonable for you to delete the local file first and then synchronize the server. Git provides a good solution to delete server files directly without affecting local files, as follows

Git rm-cached filename/-r directorygit commit "xxxx" git push

1. Delete server files and keep them locally

Git rm-cached useless.loggit commit-m "remove file from remote repository" git push

At this point, github no longer exists.

two。 Delete remote useless folder and keep it locally

It is important to note that the-r parameter is used to delete a folder.

Git rm-- cached-r uselessgit commit-m "remove directory from remote repository" git push after reading this article, I believe you have some understanding of "Git how to delete remote server files while keeping local files". If you want to know more about it, welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report