nvie / gitflow

Git extensions to provide high-level repository operations for Vincent Driessen's branching model.

Home Page:http://nvie.com/posts/a-successful-git-branching-model/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Branch and all commits lost from local machine and server when interrupting "git flow feature finish" and re-running.

fadedbee opened this issue · comments

This morning I did:

$ git flow feature finish battery

while in the feature/battery branch.

I ctrl-C'd at the first (server ssh) password prompt. (Ironically this was because I was not in the root of the repo, and wanted to be careful.)

I then repeated the same command (once I had cd'd into the root).

What I hadn't realised was that the first invocation has moved me back to the "develop" branch before I ctrl-C'd at the password prompt.

The result of attempting the "finish" a second time was an empty merge of develop into develop and the permanent deletion of the feature/battery branch (and all the commits) from both my local machine and the server.

Neither "git reflog" or "git fsck" was able to find any trace of the "feature/battery" branch or its commits.

(Luckily, I "git pull"-ed onto a third machine and so I have lost only one commit.)

Perhaps there needs to be a warning when finishing a feature when you're in develop?

My mistake. I didn't realise that I needed to commit the "finish" manually.