Git:git rm既在本地也在远程存储库中删除文件 [英] Git : git rm delete the file both locally and as well as in remote repository

查看:123
本文介绍了Git:git rm既在本地也在远程存储库中删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个硕士和开发分支。
我向开发分支做了一些提交,并按照图示推送到远程存储库。

  git checkout development 
git rm AbstractContent.java
git push -u原点开发。

我观察到 git rm AbstractContent.java命令该文件在本地被删除,但在远程存储库中它仍然存在。



请让我知道如何删除本地文件以及远程存储库。

解决方案



  git rm AbstractContent.java 
git commit -m移除AbstractContent
git push -u原始开发


I have a master and development branch . I did some commits to the development branch and did a push to the remote repository as shown

git checkout development
git rm AbstractContent.java 
git push -u origin development .

I observed git rm AbstractContent.java command the file got deleted locally , but inside remote repository it is still present .

Please let me know how can i delete the file both locally and as well as in remote repository .

解决方案

Commit before you push.

git rm AbstractContent.java 
git commit -m "Remove AbstractContent"
git push -u origin development

这篇关于Git:git rm既在本地也在远程存储库中删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆