首页 > 其他 > 详细

[Git] Cleanup and Delete Branches After a Pull Request

时间:2020-01-13 16:25:09      阅读:74      评论:0      收藏:0      [点我收藏+]

We‘ve made a pull request and now we can clean up the branches by deleting the feature branch.

Branches are just pointers to commits - so we can safely delete branches without losing the underlying commits (once the commits are merged back into master).

So we‘ll use the github interface to delete the branch remotely, and to delete it locally we‘ll use 

git remote prune origin --dry-run

 and then 

git remote prune origin

That will tell us that the remote is gone, and we can finally clean up the feature branch with: 

git branch -D feature-branch

 

Also we can always using 

git reflog

To restore any deleted branch

[Git] Cleanup and Delete Branches After a Pull Request

原文:https://www.cnblogs.com/Answer1215/p/12187673.html

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