![]() |
How can clean delete the "git branch"?
Dear Sir.
I'm want to use GIT. But git is not easy to me. I'm work on new branch But, have a misstake, for example wrong file to add. So. I'm want to delete branch and restart my work. My proceduer, see below. step 1. git clone git@test.net:test step 2. git branch test step 3. git checkout test step 4. Add some file(add wrong file to my directory) step 5. git checkout master(not commit) step 6. git branch -D test step 7. git branch new step 8. git checkout new step 9. git status But wrong file was exist. Not delete. How can clean remove my branch? Thank you |
Well, you haven't committed the file. 'git status' should list the file as untracked, and you should be able to delete the file normally (i.e. with 'rm') without using any git commands.
Hope this helps, |
Dear Snark.
Thank's your reply. I'm already add and commit using "git add" and "git commit -a" (step 4). |
Ah, I was confused by your saying "not commit" in step 5.
But if I recreate your steps: Code:
$ git initCode:
git log --grapch --oneline --allCode:
git status |
| All times are GMT -5. The time now is 11:07 AM. |