2

I'm getting this issue when I try to push to GitHub from Visual Studio Mac Version 8.10.14(build 17). Anyone know what is causing the issue?

I assume it is not passing in the name of the branch I want to commit to(I'm trying to commit to the master branch) when I click on it in the menu, which would make sense because I'm having a visual bug along with it.

This is not a parameter that is part of my code, it's a parameter from Visual Studios.

Here are screenshots of what it looks like:

When I first click on "Review and Commit" this screen appears. Normally this shows all the changes I have made, and shows "master" in the Branch parameter. For some reason this screen is appearing blank(which it normally doesn't)

enter image description here

When I click on the Branch dropdown, it shows the Master option, and then all my changes show up like so:

enter image description here

But then when I click "push changes" I get the "Value cannot be null. Parameter name: localBranch" error, as if I had not chosen "master" as the branch to choose to.

enter image description here

Anyone know what is causing this bug?

Sam Sabin
  • 553
  • 1
  • 6
  • 19

3 Answers3

3

Starting with advice from @VonC I was able to resolve the issue. While the advice he has provided has put me on the right track the solution that he has suggested turned out to be incorrect, so the right thing for me was to type this into the command line:

git rebase --continue
Ivan Ičin
  • 9,672
  • 5
  • 36
  • 57
2

For testing, switch back to command line and do a git status in the local root folder of your repository.

The goal is to check if you are working indeed on the master branch, or if you see a "detached HEAD" status, in which case you see to get back on a branch, as shown here.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I’m not super familiar with the file structure of visual studio. When I’m in the command line, how do I navigate to the root folder of my project. – Sam Sabin Dec 05 '21 at 06:24
  • 1
    @SamSabin From Visual Studio, try and "save as" a file at the root of your project (like a README): you will see the path of your project then. Check in command-line that folder has a `.git` subfolder in it. That will confirm you are in the right place. – VonC Dec 05 '21 at 06:26
  • As a part of the git status, it says I'm "currently rebasing branch 'master'". Does that mean it indeed is working on the master branch? I don't see a "detached HEAD" – Sam Sabin Dec 05 '21 at 06:43
  • 1
    @SamSabin Yes, the master branch is the target of the rebase, but any rebase in progress is in detached HEAD mode until the rebase is either completed or canceled. If there is no conflict, try `git add .`, and `git rebase --continue`. Or, if you don't want that rebase, `git rebase --abort`. If there is still rebase files, [`git rebase --quit`](https://stackoverflow.com/a/41363262/6309) can finalize the cleanup too. – VonC Dec 05 '21 at 20:55
  • I aborted the rebase but I still get the same issue. I tried completely uninstalling visual studios and reinstalling, but I still get the same problem. – Sam Sabin Dec 06 '21 at 00:20
  • 1
    @SamSabin Can you confirm that git status indicated you were on a branch after the canceled rebase? I see you have resolve your issue through a new clone. – VonC Dec 06 '21 at 06:51
  • It seemed that it was on the origin master branch, but I’m not sure. I think it’s too late to check again now that I reset everything, but that would be good for someone else to check if they had the same issue. – Sam Sabin Dec 06 '21 at 07:22
  • The right thing was to use git rebase --continue, I have provided the answer below. – Ivan Ičin Feb 17 '22 at 18:00
1

I'm not sure what the actual issue was, so please let me know if anyone finds out, but I was able to fix the issue by resetting everything. I had to completely delete the local project and delete and reinstall Visual Studios.

I just copied the changes that I needed to keep into separate files and copied and pasted them back in once I pulled from the git repository(luckily it was only a few files that hadn't been updated before all the issues started happening)

Please let me know if someone determines what actually caused the issue so I can avoid it in the future.

Just answering this in case someone comes across with the same issue.

Sam Sabin
  • 553
  • 1
  • 6
  • 19