我的目录结构:
我要删除git上的target文件夹,取消它的版本控制,本地文件夹不删,操作如下
tlimitd@DESKTOP-KKOAMOT MINGW64 /d/idea_workspace/clouddemo/Eureka-server (master)
$ git rm -r --cached target
rm 'Eureka-server/target/classes/application.yml'
rm 'Eureka-server/target/classes/com/sise/EurekaServer.class'
tlimitd@DESKTOP-KKOAMOT MINGW64 /d/idea_workspace/clouddemo/Eureka-server (master)
$ git commit -m '删除了target'
[master faca183] 删除了target
2 files changed, 12 deletions(-)
delete mode 100644 Eureka-server/target/classes/application.yml
delete mode 100644 Eureka-server/target/classes/com/sise/EurekaServer.class
tlimitd@DESKTOP-KKOAMOT MINGW64 /d/idea_workspace/clouddemo/Eureka-server (master)
$ git push -u origin master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 288 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To https://github.com/tianyugit/clouddemo.git
aa50baf..faca183 master -> master
Branch master set up to track remote branch master from origin.
成功后:
github上已经没有这个文件夹了