Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

What does the "Remove" button in SourceTree do from the Branch screen

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.
March 23, 2015

In SourceTree, if I'm on the branch screen and I click the Remove button, I get a message that says

"Confirm Remove Modified or Untracked Files?

The following files contain changes or information which is not in source control, and will be irretrievably lost if you remove them:
foo/code.php"

 

This is definitely untrue, as foo/code.php has been add and committed to my repo.

It seems to select files modified in my last commit to display the message about and to then remove them as if I had done a git rm command on them if I click Ok.

 

Is this the intended purpose of this button - to remove all the files you modified in your last commit?  What would be the logic of this?  I would intuitively expect the Remove button to take me to a screen where I could select a file(s) to remove.

 

8 answers

1 accepted

0 votes
Answer accepted
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.
March 24, 2015

so it's clearly doing an rm on "aaa/aardvark.php" in this example. But I didn't select that file. Why has it decided that when I click "remove" from the branch screen without selecting any specific files, that "aaa/aardvark.php" is the file that I want to remove? Especially when, as in the previous example, that file is not even in the repository anymore. It seems like it's selecting the most recently modified file. I don't understand what the logic of that is. Is there a use case where you would frequently want to remove the most recently modified file?

Even if that's the case, then the button should be more descriptively labeled. From the "file status" screen (which is also the "commit" screen, I can use the "Remove" button in a intuitive way to remove selected files. But on the branch screen (which is kind of the "main" or default screen), no files are particularly selected. I mean, I guess one is, if I look down at the bit of the screen showing diffs. I suppose I've answered my own question there.

Ok, I think I get it now. But it strikes me as a bad UI. If I'm looking at the top part of the screen at my commits and branches and such and now looking at the diffs, which happen to to be showing one particular file by default because I haven't selected any others, I'm really not thinking in terms of a file being selected and the buttons on the top tool bar performing operations on a particular file. This is even more true because if you look at the file selector in the lower left corner, the folder appears hi-lighted but the file doesn't. It would, of course, if I clicked on it, but I haven't yet in this example. It's just picked one file to display the detailed diff of by default.

Unintutive that if I hit "remove" from that point the file it's picked to show the detailed diff of is the one it assumes I'm wanting to remove. And even still, it's erroneously displaying the warning about changes being lost.

Seth
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.
March 24, 2015

Yeah, sounds like we're on the same page. Additional comments: The button is labelled "Remove" because that is the Git command it runs. Git doesn't use "remove" in any other context I know of (it "deletes" or "resets" branches, "reverses" commits, and "discards" uncommitted modifications). I definitely agree that the usage of those buttons when viewing commits in the log is confusing, but having them available when you are viewing "uncommitted chages" at the top of the log is useful. You might consider submitting a feature request to jira.atlassian.com if you have a complete, concrete suggestion for how the UI could be improved.

0 votes
Seth
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.
March 24, 2015

The Remove button does not remove a branch or a commit, it removes a selected file or files. In this case, you're trying to remove either aaa/aardvark.php, or all the files that are being displayed under aaa/ (which in the screenshot is just aardvark.php). I don't use tree view, so I don't know the ramifications of having a folder selected.

If you want to delete a branch, you should right-click the branch in the left panel, or do whatever keyboard acrobatics mac users have to do to get a context menu if your mouse still only has one button.

0 votes
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.
March 24, 2015

Amusingly, after committing the (somewhat arbitrary) removal that it chose to make, if I click the "Remove" button again, it attempts to remove the same (no longer present) file and gives this error message:

 

Screen Shot 2015-03-24 at 9.37.56 AM.png

0 votes
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.
March 24, 2015

@Balazs: This big button that says "Remove"

@Seth: No.  And even if I had, what process is the software using to determine which file to remove?

 

Screen Shot 2015-03-24 at 9.33.21 AM.png

0 votes
Seth
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.
March 24, 2015

Is it possible that you added and committed foo/code.php, then made additional, uncommitted modifications to it?

0 votes
Balázs Szakmáry
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.
March 23, 2015

It would be helpful if you could post a screenshot. Not really clear which remove option you are talking about.

0 votes
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.
March 23, 2015

It seems like maybe it removes the last file modified? or something?

0 votes
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.
March 23, 2015

actually it doesn't seem to do this to all files modified in the last commit. I'm not totally sure how its selecting the file that it does the "git rm" on.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events