VSCode is stuck pushing content to my GitHub repo
Asked Answered
K

8

12

When I try to push changes to my online repo, the sync icon on the left of the status bar doesn't stop rotating.

OS: Windows 10

VSCode ver: 1.58

Krause answered 15/7, 2021 at 19:55 Comment(0)
K
28

Working now

The solution was to manually run git push from the terminal. Thereafter, git integration in VSCode works.

Krause answered 16/7, 2021 at 22:30 Comment(2)
I wish one day VSCode will have more seemless GIT and FTP features. ^^Patronize
I observe that the first time I do a "git push" from the command line, I need to choose between 1) web browser auth or 2) personal token auth. And the process hangs while waiting for my choice. Probably that's the reason the "Sync" action fails for the first time. It's a pity that it doesn't show some kind of output, either as a popup and/or in the Git console.Adieu
P
12

I had a similar issue, After closing the COMMIT_EDITMSG window it was committed.

Preoccupy answered 26/8, 2023 at 20:33 Comment(2)
Thanks @Nick! your answer was the correct one for me.Lapierre
This worked for me. But putting a commit message was necessary, It did not work if I left commit message as blank.Damek
L
2

Visual Studio doesn't output Git remote error so, first of all, I would check if credentials/remote is correctly set.

Many VCS providers are switching from user/password to SSH keys and allowing read/write operations only with SSH keys the that repository gets switched. If this is the case, you would not even be able to switch branch or pull.

If this is your case, in Visual Studio go to Git/Manage Remotes and update the clone link.

Leeuwenhoek answered 22/8, 2022 at 11:28 Comment(0)
P
1

I had the same problem. I've decided to commit from terminal. The command git add --all added my new files. After this, icon 'Commit' started work correctly. (But you can also type git commit by yourself). I hope, It'll help somebody

Pontificals answered 25/3, 2023 at 15:25 Comment(0)
C
1

For me, this happens when I forget to enter a Commit Message. VSCode then opens the COMMIT_EDITMSG file for editing. Entering a message, saving the file, and clicking the checkmark (highlighted in green) resolves this for me.

enter image description here

Connacht answered 25/6 at 17:31 Comment(0)
P
0

Use SSH key pair

  1. Generate an SSH key pair using ssh-keygen command with your email address as a label.
ssh-keygen -t rsa -b 4096 -C "[email protected]"
  1. Add your public key to your Git account.

    • Copy your public key to your clipboard using the following command(if you're in linux):
xclip -sel clip < ~/.ssh/id_rsa.pub
-   Go to your Git account settings and click on “SSH and GPG keys”.
-   Click on “New SSH key” or “Add SSH key”.
-   Paste your public key into the “Key” field and click on “Add SSH key”.
  1. Update your remote URL to use SSH instead of HTTPS.
git remote set-url origin [email protected]:username/repo.git
  1. Test your connection by running ssh -T [email protected].
  2. Push your changes using git push.

hope this helps

Pazpaza answered 7/4, 2023 at 15:22 Comment(0)
K
0

I had the same issue when I was doing COMMIT, and it was an endless process. The solution is always to put a message on the top of the commit before committing.

Ketron answered 12/4 at 20:14 Comment(0)
C
-1
  1. Close VS Code
  2. Reopen VS Code
  3. Remember to write a message this time before pressing Commit.
Calcariferous answered 25/7 at 20:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.