Deleting git branch loses audit

霸气de小男生 提交于 2019-12-08 02:49:51

问题


If a branch has been deleted in git is it still possible to identify whether specific commits were made on that deleted branch?

From what I have found so far - git branches are merely pointers so deleting them would lose the that specific part of the audit history.

Hoping that I can be proven wrong on this.

thanks,


回答1:


git branches are merely pointers

Yes and which is exactly why deleting them would delete just the pointer.

If you have merged the branch to your mainline, you no longer need that pointer; but you will always know what all commits were made to that branch individually, unless you explicitly choose to not know the specific changes by asking for a fast-forward merge.




回答2:


The details of exactly which branch you made your commits to are lost once you merge back to another branch. This is detailed in this post and this.

You shouldn't delete branches which are long running and which you wish to keep track of. The act of deleting a branch is a statement of sorts saying that you don't care about that path but from that point on but just about the code.



来源:https://stackoverflow.com/questions/10581881/deleting-git-branch-loses-audit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!