【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 ..." 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,git)