I am unable to push commits from VS Code to a remote github repository


i have a project on Visual Studio Code titled random-quote-machine and I initialized a git repository in this project in VS Code, and then staged and committed all the files in the project.

i next added a remote repository (again in VS Code) and then next tried to push the commits, but I have been unable to do so, despite all my efforts and the hours I 've spent. Rather, it will tell me to sign in to github and after signing in, the push attempt would fail and it will tell me authentication failed and most times give the output below in Visual studio code:

git push random-quote-machine master:master

fatal: TaskCanceledException encountered.

   A task was canceled.

Everything up-to-date

> git status -z -u

> git symbolic-ref --short HEAD

> git rev-parse master

> git rev-parse --symbolic-full-name master@{u}

> git rev-list --left-right master...refs/remotes/random-quote-machine/master

> git for-each-ref --sort -committerdate --format %(refname) %(objectname)

> git remote --verbose

> git config --get commit.template

Please i will appreciate if some help could be rendered me on this issue, as i need to urgently push various VS Code projects to github. Thanks.

1 Like

Hi @obij - Welcome to the GitHub Community!

When you have 2FA enabled, certain actions will require the use of a personal access token rather than your regular username and password:

Sounds like this might be related. Please give that a try and let me know if you’re still running into trouble.