Open SimonSiefke opened 1 year ago
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.78.1. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
@SimonSiefke, the issue with the disabled action following the commit has been fixed in the latest Stable/Insiders release. I will go ahead and optimistically close this issue but if you are still able to reproduce the problem please feel free to reopen it. Thanks!
I just checked and the problem still reproduces in 1.79-0 insiders. I think this is unrelated to the disabled action following the commit issue.
@SimonSiefke, so we are scoping the issue to the fact that you cannot push to a newly created GitHub repository. I have rewatched the recording that you have provided and couple of things that I would like you to try:
1) When you get the error when pressing the "Commit & Sync" button, can you please click on the "Show Command Output" button and share the contents as that will tell us more about the error that we are seeing.
2) Are you getting the same error message if you try to run git commit
and git push
from the integrated terminal?
> git pull origin main
fatal: couldn't find remote ref main
It seems the issue isn't with push, but with git pull since the remote main branch doesn't exist. I further narrowed down the issue to the following vscode git settings:
{
"git.postCommitCommand": "sync",
"git.confirmSync": false,
}
What would think about only running git pull
only if the remote branch exists?
Yes, this is an edge case that we would have to handle. For the time being, when you run into this error you can run the "Git: Push" command which will create the remote branch. After that you should be able to successfully "Commit & Sync" without experiencing any errors.
I have the same error rn. And it is really frustrating to use the terminal ever so on. It would be really cool if you can do this in VS Code just to safe some time and don't tap out every time just to create the branch..
Having the same issue from the last couple of days.
Hi I may have a similar problem and found a workaround.
Problem I created an empty repository on github under a Organization. I cloned this repository in vscode using Source control -> clone repository and selecting the newly created one when it pops up in the upper field. When i try and sync or push changes to the repository i get a message that Git can't find the remote ref main.
Solution In github, create a file in the newly created repository (any text file will do) Clone the repository as before in vscode You can now sync and push changes to the repository.
Cause It seems like when you create a completely empty repository in github, the main branch isn't created. I am guessing vscode or git assumes that the main branch must be there.
Does this issue occur when all extensions are disabled?: Yes/No
Steps to Reproduce:
Using the terminal and running
git push
works as expectedScreencast of the issue: https://github-production-user-asset-6210df.s3.amazonaws.com/23744935/237189688-5afc569f-2966-4061-9b6e-0018d7501dfa.mp4