我怎样才能完全清除git仓库中的一个分支? [英] How can I completely clear just one branch in a git repo?

查看:155
本文介绍了我怎样才能完全清除git仓库中的一个分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序的原型版回购。



我想存储此原型的代码以供将来参考,但不包括任何文件在下一个版本的代码中,我将从一个新的分支开始创建。



到目前为止,我已经为原型创建了一个新的分支,推送到我们的远程存储库 - 这是安全的,并没有去任何地方。



回到我的本地主分支我想从一个完全干净的石板开始 - 全部删除目前列出的文件。



有没有更简单的方法来处理这个问题,而不是简单地删除文件?



我记得在设置github页面的时候我曾经使用过一个方法,但是这个文档似乎已经被移动了:/ b / b

提前致谢

解决方案

以下是博文创建一个没有祖先的分支。它描述了两种可能的方式,你可以尝试两种方式,看看哪一种更适合你。


I have a prototype version of an app in a repo.

I'd like to store the code from this prototype for future reference but not include any of the files in the next release version of the code which I'll start form scratch on a new branch.

So far, I've created a new branch for the prototype and pushed that to our remote repository - that's safe and not going anywhere.

Back on my local, master branch I'd like to start with a completely clean slate - remove all the files currently listed.

Is there a more gitish way to approach this than simply removing the files?

I remember there was a method I used previously when setting up github pages for a repository but the documentation for that seems to have moved :/

Thanks in advance

解决方案

Here's a blog post on creating a branch without ancestry. It describes two possible ways, you can try both and see which one works better for you.

这篇关于我怎样才能完全清除git仓库中的一个分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆