0
点赞
收藏
分享

微信扫一扫

Git如何删除远程仓库的文件目录

 

1. ​​GIT删除指定的某次版本提交​​

1.1 cmd

git log  // 获取提交信息
git rebase -i (commit-id) // commit-id 为提交版本的hash code,即commit-id是需要删除的前一个hash code

注意: 这里有个坑,commit-id是需要删除的前一个hash code;

1.2 使用命令后,打开一个文件,将需要删除版本的hashcode前面的pick改为drop,然后保存退出即可;

 

2. 删除某次提交,回退到某个版本

先git reset —hard强制回到需要的点,

git reset --hard commit_id(回退到某个版本的id)

git push -f origin branch_name

git push origin HEAD --force

 

 

 

 

3. 删除远程仓库的文件目录

 

参考

1. ​​GIT删除指定的某次版本提交​​;

2. ​​git 删除远程仓库的某次提交​​;

举报

相关推荐

0 条评论