git 如何从不需要的Meta/config合并中恢复?

toiithl6  于 12个月前  发布在  Git
关注(0)|答案(3)|浏览(139)

我一直在本地修改gerrit访问文件,而不是在UI中这样做-当你有批量操作时更容易。
要访问这些文件,我需要“git pull origin refs/Meta/config”-这是它们在项目中的显示方式。
现在我希望它们消失,我不希望在项目中再看到它们-我如何才能使属于该引用的文件消失?如何取消获取该引用?

unftdfkk

unftdfkk1#

使用git-pull,您已经将引用refs/meta/config合并到当前分支(可能是master)。你在哪里见过这个命令行?如果要修改meta/config引用中的文件,应使用类似于those recommended here的命令行:

git fetch origin refs/meta/config:refs/remotes/origin/meta/config
git checkout meta/config
//edit... and then push:
git push origin meta/config:meta/config

现在的问题是,您确实使用了git-pull。使用git log --merges --first-parent,尝试查找合并该分支的修订版本。然后用git git revert <commit-id>撤销合并。

l5tcr1uw

l5tcr1uw2#

假设ref在本地也被称为refs/meta/config,并且文件从未提交到另一个分支,如master

git checkout master
git update-ref -d refs/meta/config

如果这不起作用,请查看引用是否以不同的名称(可能类似于refs/remotes/origin/meta/config)存储在本地

git branch -a

您需要在branch显示的输出之前添加refs/

qzwqbdag

qzwqbdag3#

一个小的变化接受的答案:

//edit... and then push:
git push origin meta/config:refs/meta/config

相关问题