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.
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it possible that you added and committed foo/code.php, then made additional, uncommitted modifications to it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It would be helpful if you could post a screenshot. Not really clear which remove option you are talking about.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It seems like maybe it removes the last file modified? or something?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.