0


【git】【rm】删除一个本地文件,并提交到远端(删除远端这个文件)

【git】【rm】删除一个本地文件,并提交到远端(删除远端这个文件)

1.删除本地文件命名

%
git rm View.qml

rm '/View.qml’

2.查看状态

%
git status

On branch master

Your branch is up to date with 'origin/master'.

Changes to be committed:

(use "git restore --staged <file>..." to unstage) 

  deleted:    View.qml 

3.commit并备注

%git commit -m "[UI]: delete no use file View.qml."

[master 5e2ba9e] [UI]: delete no use file View.qml..

1 file changed, 75 deletions(-)

delete mode 100644 /View.qml

4.推送到远端仓库

%
git push

Enumerating objects: 15, done.

Counting objects: 100% (15/15), done.

Delta compression using up to 8 threads

Compressing objects: 100% (7/7), done.

Writing objects: 100% (8/8), 689 bytes | 689.00 KiB/s, done.

Total 8 (delta 4), reused 0 (delta 0), pack-reused 0

To xxxxxx master -> master

5.再次查看状态

%
git status

On branch master

Your branch is up to date with 'origin/master'.

标签: git

本文转载自: https://blog.csdn.net/maoyingyong/article/details/127649261
版权归原作者 goodmao 所有, 如有侵权,请联系我们删除。

“【git】【rm】删除一个本地文件,并提交到远端(删除远端这个文件)”的评论:

还没有评论