Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

SourceTree Errors with Gitflow

Bob Provencher August 11, 2014

Occasionally when pulling we recieve the following error:

git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin

From https://github.com/pdhiscc/conxus-web

* [new branch] feature/NET-22_Client_compliance_reporting -> origin/feature/NET-22_Client_compliance_reporting

error: Ref refs/remotes/origin/feature/NET-59 is at 1ce1dab2397ab550981a5304a8104c86e384f1b9 but expected 34ae75a0a9e6a452c8cc5939c34828ddfa7392ea

! 34ae75a..1ce1dab feature/NET-59 -> origin/feature/NET-59 (unable to update local ref)

Upon examination of the remote we see two feature branches for NET-59, one with uppercase Feature and another with lowercase feature.

We have no idea how or why this is occuring as the team is using the Git Flow exclusively, all from windows boxes. Recloning the repo seems to temporarily solve the issue, but we've had to do it enough times now that we are worried it could cause larger issues.

Our repo is on github but we are open to moving it to bitbucket if that will help.

Ideas?

2 answers

1 vote
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 11, 2014

The problem here is that Windows is case-insensitive, while Git and Linux are case-sensitive.

From manojlds on StackOverflow: "Branches are just pointers to a commit. These pointers are just files." Since filenames are case-insensitive on Windows, both of the branches you have (feature/* and Feature/*) are trying to update the same pointer file, which is bad.

To fix, you should delete the incorrectly-cased branch from the remote, and review your developers' gitflow settings to make sure none of them accidentally set their feature prefix with a capital F.

If there are unique commits in the branch that needs deleted, tag it first, and you can merge or cherry-pick into the correct branch once things are fixed.

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 11, 2014

Instruct your users to either

  • always use only lowercase when creating branches locally or
  • create their branches on the web interface and then pull them to their clones,

to avoid this kind of problem in the future.

0 votes
Bob Provencher August 12, 2014

Sounds simple enough! Thanks ;)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events