GIT is not working properly

Problem description:
Git is defaulting to a bad branch, and trying to change it to a good branch crashes.

Expected behavior:
Git does not try to access origin/origin/main, and switching to origin/main does not crash.

Actual behavior:
Git is defaulting to the branch origin/origin/main, attempting to change the branch to origin/main causes a repl crash.

Steps to reproduce:

  1. Have a repl that defaults to a branch that has origin in its name twice
  2. See issue 1
  3. Try to change branch to the “normal” branch
  4. See issue 2

Bug appears at this link:
https://replit.com/@Firepup650/firepup650-PYPI-Package

Browser/OS/Device:
Replit app/Android 13/Samsung phone

Hey @Firepup650!

Thank you for reporting this. I will send this to the right people so we can get this fixed!

3 Likes

Hey! Would you mind recording a loom.com video of how to reproduce this from scratch? We looked at your Repl and tried to reproduce this on our own Repl but weren’t successful.

I’ll at least record the bug in mine, but I’m not sure how it was triggered. Hang on.

Have a recording of the bug, I will upload it to my image hosting repl in a little bit. As for steps to reproduce, I’m not sure, but it was a fork of another repl that had an existing GitHub repl linked to it, so maybe that has something to do with it.

1 Like

Sorry for the delay, here’s the video:

(I put it on a Bullet Point so that discourse won’t load the video and kill my egress hopefully)

1 Like

Thanks, we will look into this!

(Also, I have downloaded the video as to not fill up your egress each time I need to reference it)

1 Like

We are still looking into this issue. Out of curiosity, does forking the Repl fix the issue @Firepup650?

Forking the repl with the issue persists the issue, I thought it would cause it to add a another layer of origin to the GIT repo, but it did not. It just stayed at the same bugged out level.

1 Like

Adding on to this topic, backing up files, manually overriding branch, restoring backup, making any necessary edits (Removing/Adding files), and pushing to Git by hand does resolve the issue, though the buggy branch still exists. I have intentionally not done this on my main Repl until we have any idea into why this occured.

Commands you can use to repair Git
zip && unzip
zip bkp.zip .*
mv bkp.zip ..
git branch -f main
mv ../bkp.zip .
unzip bkp.zip
echo do your git fixes here, add/remove files as neccessary
git commit -a -m "Git Patch"
git push -fu origin main

Notes:

  1. Press y when replit asks if you want to add “zip” and “unzip”
  2. zip and unzip will be slow, this is to be expected, we’re backing up all of venv here.
  3. Press AEnter when zip asks about overwriting files.
  4. Yes, A must be uppercase in step 3.
2 Likes