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

Finishing feature prevents starting another: fatal: cannot lock ref 'refs/heads/feature/xxx': unable to create directory for .git/refs/heads/feature/xxx

remidoolaeghe opened this issue · comments

I have a problem when finishing a feature.

Here is what I do:

git flow feature start my_feature

[Make some commits on this feature]

git flow feature finish my_feature

Switched to branch 'develop'
Your branch is up to date with 'origin/develop'.
Updating 843b148..090851b
Fast-forward
[...]
 3 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 app/models/referential.rb
 create mode 100644 db/migrate/20190218145358_create_referentials.rb
To [REPO URL]
 - [deleted]         feature/S229_static_referential
Deleted branch feature/S229_static_referential (was 090851b).

Summary of actions:
- The feature branch 'feature/S229_static_referential' was merged into 'develop'
- Feature branch 'feature/S229_static_referential' has been locally deleted; it has been remotely deleted from 'origin'
- You are now on branch 'develop'

Here everything is fine. Then, I'd like to start a new feature:

git flow feature finish my_new_feature

Here, I get following output:

fatal: cannot lock ref 'refs/heads/feature/my_new_feature': unable to create directory for .git/refs/heads/feature/my_new_feature
Fatal: Could not create feature branch 'feature/my_new_feature'.

I don't understand why I have this behavior. I noticed there is a problem with the folder .git/refs/heads/feature. I just can't open it, delete it or do anything with it. Windows is telling I am not administrator. But actually I am. When trying to do it with WSL (Windows Sub-system for Linux), with my installed Ubuntu 16.04, Ubuntu shows the folder when using ls, but trying to remove it makes an error:

$> ls .git/refs/heads
develop  feature  master
$> rmdir .git/refs/heads/feature
rmdir: failed to remove '.git/refs/heads/feature': No such file or directory

After rebooting my machine, the folder just disappears, letting me working on a new feature as expected.

The result is the same when using the CLI or SourceTree.

OS : Windows 10 + Ubuntu 16.04 (WSL)
Git flow version : 1.11.0 (AVH Edition)