source tree delete branch graph

Per Eghall October 15, 2015

Hi folks,

 

I have an additional branch (new_branch) that has forked from master branch, that exists in both remote origin and in my local repository. The new_branch is deleted from origin and from my local repository, however, the branch is still displayed in SourceTree graph! Is there a way to remove it from the graph?

 

Best regards,

Per

1 answer

1 vote
Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2015

Deleting a branch within git is simply removing the symbolic name of the branch. The commits on the branch still exists, even after deleting the branch. Therefore you can still see the branch within SourceTree (but the branch has no name anymore - since the symbolic name was deleted by you ...)

That's one of the main features of a VCS: preserving commits ....

If you want to remove the commits from your repository, you need other git methods  (see: http://stackoverflow.com/questions/1338728/delete-commits-from-a-branch-in-git)

 

Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2015

Be aware: Deleting commits (generally: modifiying commit history) on the remote repository is considered a bad practice (https://developer.atlassian.com/blog/2015/04/force-with-lease/) - nevertheless you still have to use it sometimes. You should be aware of the consequences - and ponder ...

Tim Crall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 19, 2015

The commits should only continue to show up on the graph if the branch was merged into another branch before deletion. A screenshot might help illustrate exactly what's being asked about here.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events