in sourcetree, I stop tracked a file yestoday, but I want to commit it to repository. how can i do it? please help me
(Assuming you right-clicked on a file and selected the "Stop tracking" option.)
This command stages a change that deletes the file (line with a red minus in the beginning in the pending changes), but leaves the file intact on your disk (it shows as an untracked file):
image2015-5-22 11:10:26.png
You can undo this by right-clicking on the line with the red minus and selecting "Discard".
EDIT: once this deletion is committed, this is how to undo it:
I edited the answer to show the recovery steps for this case as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think in step 3 you want to "Reverse commit".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
He does not necessarily want to revert the other changes in the commit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
True, but "reset to commit" will change the history, which will be a problem if he's pushed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This reset is not that reset. :) It resets a file to a certain state, not the commit history to an earlier point.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, not clear that you meant to right click on the FILE rather than the COMMIT: "select the last revision where the file was still there ... right click on it".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Step 3 happens in the file history window. (Opened in step 2.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What exactly do you mean by "I stop tracked a file"?
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.