开发者

Remove detached branches from git repository

开发者 https://www.devze.com 2022-12-07 17:25 出处:网络
I played with another remote called tmp. I added the remote and pushed the branches master and new-branch. Then I deleted the the tmp remote.

I played with another remote called tmp. I added the remote and pushed the branches master and new-branch. Then I deleted the the tmp remote.

Now the branches tmp/master and tmp/new-branch are detached. I don't need them anymore. How do I delete them along with their commits?

Here is graph on my repo now:

* a856b8c - (HEAD -> master, tag: abc, origin/master) Update                                                                                                                                                                                                  
| * 8a142e4 - (tmp/master) Update                                                                                                                                                                                                                             
|/                                                                                                                                                                                                                                                            
| * 5d43564 - (tmp/new-branch) New commit                                                                                                                                                                                                                     
| * f9f33d9 - New commit                                                                                                                                                                                                                                      
| * 9869631 - New commit                                                                                                                                                                                                                                      
| * 03cdb15 - New commit                      开发者_JAVA技巧                                                                                                                                                                                                                
| * 7a24a77 - Test                                                                                                                                                                                                                                            
|/                                                                                                                                                                                                                                                            
* 97b8dcd - Skip lines

So I want to delete commits: 8a142e4, 5d43564 and so on from the repo's history.

0

精彩评论

暂无评论...
验证码 换一张
取 消