首页 > 其他 > 详细

Git 删除文件

时间:2019-12-14 18:01:40      阅读:92      评论:0      收藏:0      [点我收藏+]

从仓库删除文件会经历以下几步:

技术分享图片

 

 

1、使用删除命令删除文件

git rm 要删除的文件

1
2
# git rm hello.txt
rm ‘hello.txt‘

2、更新到临时区

1
2
3
4
# git commit -m "删除 hello.txt"
[master 117adf3] 删除 hello.txt
 file changed, 1 deletion(-)
 delete mode 100644 hello.txt

3、push到远程仓库

1
2
3
4
5
6
7
8
9
# git push
Username for https://github.com# 此处输入github账号
Password for https://xxx@github.com:  # 此处输入github账号密码
Counting objects: 3, done.
Compressing objects: 100% (1/1), done.
Writing objects: 100% (2/2), 242 bytes | 0 bytes/sdone.
Total 2 (delta 0), reused 0 (delta 0)
To https://github.com/xxx/gitDemo.git
   7c1b9ee..117adf3  master -> master

Git 删除文件

原文:https://www.cnblogs.com/max-hou/p/12040307.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!