If you are in windows use this line in your git bash:

git config --global credential.helper wincred

Next time git will remember your password. Thats all, the VSCode will work fine ;)

Bye Bytes !

Answer from Esteban Quintana on Stack Overflow
🌐
Visual Studio Code
https://code.visualstudio.com › docs › sourcecontrol › overview
Source control in VS Code
November 3, 2021 - Staging selects the changes for your next commit. Committing records that snapshot in local Git history, but does not upload it to a server. Learn how to stage files or individual lines and create a commit. Push uploads your commits, pull integrates remote commits, and sync pulls before pushing.
Discussions

How to git push to a different branch with Visual Studio Code? - Stack Overflow
I realized that after a commit in VSCode there's a "Push" menu option that pushes the commit to the default branch. However, I often need to push it as well to different branches. Is there a way t... More on stackoverflow.com
🌐 stackoverflow.com
Shortcut to push code to git in VSCode? - Stack Overflow
In VS Code, the only way that I know of to push commits with git is to go into the "..." menu of the Source Control tab and click Push. That method seems a bit roundabout to me, especially consider... More on stackoverflow.com
🌐 stackoverflow.com
git - Visual Studio Code push automatically - Stack Overflow
Is it possible to make git push after commit automatically? Now I need to click on push after commit manually and this is not very comfortable. More on stackoverflow.com
🌐 stackoverflow.com
git - How to add a new project to Github using VS Code - Stack Overflow
In case you are using Visual Studio code for Angular project, after running the init, it will prompt you to add node_modules to gitignore. Please select Yes. 2025-10-28T12:16:33.71Z+00:00 ... @Xsmael you could have mentioned that in the question title clearly then..However I'll look into this as well 2019-04-26T15:12:00.003Z+00:00 ... I had to use --force in the push ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
GeeksforGeeks
https://geeksforgeeks.org › git › gitpush-with-visual-studio-vs-code
GitPush With (Visual Studio) VS Code - GeeksforGeeks
July 23, 2025 - Visual Studio Code (VS Code) is a powerful and versatile code editor widely used by developers. One of its standout features is its seamless integration with Git, making version control very simple.
🌐
Graphite
https://graphite.com › guides › how-to-push-code-from-vscode-to-github
How to push code from VS Code to GitHub - Graphite
... Visit GitHub and sign in. Click on the "New" button under the "Repositories" tab. Enter your repository details and create the repository. Connect your local repository to your GitHub repository:
🌐
Visual Studio Code
https://code.visualstudio.com › docs › sourcecontrol › quickstart
Quickstart: use source control in VS Code
November 3, 2021 - Make a first Git commit in Visual Studio Code with a practice project, then optionally publish it online.
🌐
Salivity
https://salivity.github.io › visual-studio-code › article › push-commits-to-a-remote-repository-in-vs-code
Push Commits to a Remote Repository in VS Code - visual-studio-code
If you prefer using keyboard shortcuts without opening the side panel, you can use the Command Palette. Open the Command Palette by pressing Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS). Type Git: Push into the search bar.
🌐
Techielass
https://techielass.com › how-to-push-code-from-vs-code-to-github
How to push code from VS Code to GitHub
October 23, 2025 - Learn how to push code from VS Code to GitHub step by step. This beginner-friendly guide covers committing, adding remotes, and publishing your VS Code project online.
Find elsewhere
🌐
GitHub
https://microsoft.github.io › vscode-essentials › en › 05-git.html
Use Git in VS Code · Visual Studio Code - The Essentials
The push command is accessible from several places: in the status bar, to the right of the current branch name, in the command palette Git: push, or in the context menu of the sidebar, accessible on the ... icon at the top right. Retrieving remote commits is also simple using the Pull (pull) ...
🌐
Medium
https://medium.com › @555mohann › how-to-push-pull-and-work-with-git-in-visual-studio-code-or-other-ides-9b0e3af68f61
How to Push, Pull and Work with Git in Visual Studio Code or Other IDE’s. | by MohanaKrishnan S | Medium
April 9, 2020 - Step 3: Say, Open Visual Studio Code and create a floder “Test Program”.and create new python file in it TestProgram.py. ... i).if you have created README.md file automatically while creating repo. you need to pull the origin to local before initial commit. $ > git pull origin master — allow-unrelated-histories · ii).if you haven’t created README.md file. you can push the local repo to origin.
🌐
Microsoft Learn
https://learn.microsoft.com › en-us › visualstudio › version-control › git-push-remote
Push to a remote branch in Visual Studio | Microsoft Learn
The "outgoing" text represents ... but not yet pulled from the remote. To push to your remote, select Push button (the up arrow), or select Push from the Git menu....
🌐
Everhour
https://everhour.com › github › how to push to github: complete step-by-step guide
How to Push to GitHub from VS Code or Terminal
December 22, 2025 - Wrong branch? Use git checkout main or the correct branch ... Initialize repo → Add remote → Add files → Commit → Push.
🌐
JC Chouinard
https://jcchouinard.com › accueil › how to commit and push code to github repository (vs code example)
How to Commit and Push Code to Github Repository (VS Code Example) - JC Chouinard
April 4, 2025 - When all is done, go back to your ... Visual Studio Code to GitHub, open the Terminal in VS Code and execute the git push origin master command....
🌐
Visual Studio Code
https://code.visualstudio.com › docs › sourcecontrol › repos-remotes
Working with repositories and remotes
November 3, 2021 - ... In the Source Control view (⌃⇧G (Windows, Linux Ctrl+Shift+G)), select More Actions (...) > Remotes > Add Remote. Alternatively, run the Git: Add Remote command from the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)).
🌐
An Amateur Computational Mathematician
https://scaomath.github.io › blog › git-workflow-vscode
Shortcut to git commit and push in Visual Studio Code - An Amateur Computational Mathematician
July 4, 2021 - (Assume we are done writing in source branch) Commit and push all changes in source branch. Build site with the production JEKYLL_ENV. Sync the site to master branch (and come back to source). #!/bin/bash git add . && \ git commit -m "Update pages in source" --allow-empty && \ git push origin source && \ JEKYLL_ENV=production bundle exec jekyll build && \ git checkout master && \ cp -r _site/* .
Top answer
1 of 16
221

Here are the detailed steps needed to achieve this.

The existing commands can be simply run via the CLI terminal of VS-CODE. It is understood that Git is installed in the system, configured with desired username and email Id.

  1. Navigate to the local project directory and create a local git repository:

    git init

  2. Once that is successful, click on the 'Source Control' icon on the left navbar in VS-Code.One should be able to see files ready to be commit-ed. Press on 'Commit' button, provide comments, stage the changes and commit the files. Alternatively you can run from CLI

    git commit -am "Your comment"

  3. Now you need to visit your GitHub account and create a new Repository. Exclude creating 'README.md', '.gitIgnore' files. Also do not add any License to the repo. Sometimes these settings cause issue while pushing in.

  4. Copy the link to this newly created GitHub Repository.

  5. Come back to the terminal in VS-CODE and type these commands in succession:

    git remote add origin <Link to GitHub Repo> //maps the remote repo link to local git repo

    git remote -v //this is to verify the link to the remote repo

    git push -u origin master // pushes the commit-ed changes into the remote repo

Note: If it is the first time the local git account is trying to connect to GitHub, you may be required to enter credentials to GitHub in a separate window.

  1. You can see the success message in the Terminal. You can also verify by refreshing the GitHub repo online.
2 of 16
67

This feature was added in 1.45, demoed here.

Launch the command palette Ctrl+Shift+P, run Publish to Github, and follow the prompt. You will be given the choice between a private and public repository, so be careful that you choose the right one.

It may ask you to login to github. It will then prompt for the repo name (defaults to the name of the folder), and for creating a .gitignore file (defaults to empty .gitignore). Just hit enter if you are fine with the defaults. When you are done it should give you a popup notification in the bottom right with a link to the repo https://github.com/<username>/<reponame>

Minor warning: if your project already has a .gitignore file in it this process will overwrite it

🌐
Medium
https://medium.com › @shouke.wei › how-to-push-a-project-to-github-from-vs-code-no-stress-4aa83ce197a4
How to Push a Project to GitHub from VS Code (No Stress!) | by Dr. Shouke Wei | Medium
July 4, 2025 - Whether you’re building a side project, learning Git for the first time, or just want to save your code in the cloud, uploading a project to GitHub is a crucial step. Visual Studio Code makes this easier than ever with its built-in Git integration. In this post, I’ll walk you through how to push your local project to a new GitHub repository directly from VS Code using both the terminal and the built-in UI.