Home > Back-end >  I have a problem setting up git repository and pushing changes in visual studio code
I have a problem setting up git repository and pushing changes in visual studio code

Time:05-14

how to set git up in vs code. help i cant set it up. When i try to push a commit it shows cant find repository and shows a publish branch button and it opens a windows saying set core.fwmonitor to true. how to push a chnage to you git repository main branch

CodePudding user response:

First of all to being able to use Github with VSCode is to set-up Git on your computer and enable in it VSCode.

  1. Enable Git in VS Code
  1. Go to File > Preferences.
  2. Go to Settings.
  3. Type Git: Enabled in the search bar.
  4. Make sure that the box is ticked.

References :

check the bellow reference example for mere steps

https://www.jcchouinard.com/install-git-in-vscode/

https://code.visualstudio.com/docs/editor/versioncontrol

CodePudding user response:

Seems like you have not initilize git till now in your project ,

simply run git init in your project folder

the message should say Reinitialized existing Git or now initilized.

if not, then check weather you have git set it up properly or not.

now you can stage and then commit changes to your repo.

if you want to push code to remote branch then, you have to first set origin where you want to push.

git remote add origin your_repo_url

Hope it works.

  • Related