Giter VIP home page Giter VIP logo

Comments (9)

newren avatar newren commented on July 23, 2024 5

Ahah, since git will store branches by default in files based on the name of the ref (e.g. .git/refs/remotes/origin/API_changes_to_surface_all_named_layer and .git/refs/remotes/origin/api_changes_to_surface_all_named_layer), any repository with branches/tags that differ in case only cause problems on a case-insensitive filesystem. The reason you can sometimes work with it is that git tries to move refs that you haven't used for a while from their individual files to combine them all into one big .git/packed-refs file (and puts everything in there for new clones). So things work until you attempt to touch both branches, and history rewriting touches both branches.

As to the way forward, you have a few choices:

  • Run on linux (on a case sensitive filesystem, though the default filesystems all are)
  • Create a case sensitive filesystem on your Mac; it may not be the default, but macs do support it
  • Delete or rename one of these conflicting branches before doing any history rewrites.

Which of these you choose is up to you; I'm a fan of using linux, but the others should be able to solve your problem as well.

from git-filter-repo.

newren avatar newren commented on July 23, 2024

What's the output of git show-ref and, if that output is big, then perhaps the output of just git show-ref | grep -i remote_branch?

from git-filter-repo.

chambers-y avatar chambers-y commented on July 23, 2024

Thank you for responding. As you predicted, git show-ref outputs quite a bit.
The output of git show-ref | grep -i remote_branch is:

chamber:~/tmp/baker (master) $ git show-ref | grep -i remote_branch
d83eb71ac940c0dc6188865ddc5560b9863eaf3d refs/remotes/origin/remote_branch
2ad485fc5fbd8b886a8609b283217a221a77844f refs/remotes/origin/remote_branch

Is there a conflict between these two refs?

from git-filter-repo.

newren avatar newren commented on July 23, 2024

Um, that's not two refs, that's just one. I expected to see two branches that differed in case only (e.g. refs/remotes/origin/remote_branch and refs/remotes_origin/Remote_Branch) and point out that you're probably on a buggy (case insensitive) filesystem, but now I'm left wondering how you ended up with a single ref that points at two different places. It might still be some kind of case insensitive insanity but perhaps with more steps to get to this point. So a few more questions:

What's the output of grep -i remote_branch .git/packed-refs and find .git/refs -iname remote_branch, and git ls-remote origin | grep -i remote_branch?

from git-filter-repo.

chambers-y avatar chambers-y commented on July 23, 2024

Sorry for the confusion. I just realized that the first branch started with a capital case and the second one started with a lower case: it looks like case insensitivity is the culprit after all.

I have included the full output with the (real) branchname below to be clear:

chambers:~/tmp/baker (master) $ git show-ref | grep -i API_changes_to_surface_all_named_layer
d83eb71ac940c0dc6188865ddc5560b9863eaf3d refs/remotes/origin/API_changes_to_surface_all_named_layer
2ad485fc5fbd8b886a8609b283217a221a77844f refs/remotes/origin/api_changes_to_surface_all_named_layer

chambers:~/tmp/baker (master) $ grep -i API_changes_to_surface_all_named_layer .git/packed-refs
d83eb71ac940c0dc6188865ddc5560b9863eaf3d refs/remotes/origin/API_changes_to_surface_all_named_layer
2ad485fc5fbd8b886a8609b283217a221a77844f refs/remotes/origin/api_changes_to_surface_all_named_layer

chambers:~/tmp/baker (master) $ find .git/refs -iname API_changes_to_surface_all_named_layer
chambers:~/tmp/baker (master) $ # no output

chambers:~/tmp/baker (master) $ git ls-remote origin | grep -i API_changes_to_surface_all_named_layer
d83eb71ac940c0dc6188865ddc5560b9863eaf3d	refs/heads/API_changes_to_surface_all_named_layer
2ad485fc5fbd8b886a8609b283217a221a77844f	refs/heads/api_changes_to_surface_all_named_layer

Should I run git filter-repo on a linux operating system?

from git-filter-repo.

chambers-y avatar chambers-y commented on July 23, 2024

Thank you for the in-depth response. I'll give it a shot and update this thread with the results.

Fingers crossed!

from git-filter-repo.

chambers-y avatar chambers-y commented on July 23, 2024

Your suggestion fixed my issue.

Thanks for the wonderful tool. I appreciate being able to copy-paste one file and edit it to fit my needs.

Great job, Maintainer!

from git-filter-repo.

rggammon avatar rggammon commented on July 23, 2024

I'd just add that, if you are on windows, you can install Windows Subsystem for Linux (WSL2) - I hit this issue, installed WSL2+Alpine, and was able to get a case sensitive filesystem this way.

from git-filter-repo.

ruben-cit avatar ruben-cit commented on July 23, 2024

For future people: I ran into the same issue and trying to solve using a Docker Debian image didn't work. What ended up working was creating a case-sensitive volume on my Mac (via the article here) and running the commands in there.

from git-filter-repo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.