toddmo
toddmo

Reputation: 22406

Confused about git integration in Visual Studio Code

In Visual Studio Code, I clicked on something to link my project to git, now it says "master" in the bottom left but I don't know where the repository is, physically.

Then I created my repository on github. Say my user is mygitusername and my project is myprojectname.

I made a bunch of changes in vs code and actually did a commit in vs code. It took them but I don't know where they went.

Now I want to see my code on github, but I don't know how to get it up there.

See, it won't run this in VS code and I don't know how / where to run this:

git remote add origin https://github.com/mygitusername/myprojectname.git
git push -u origin master

I'm not saying it runs it and gives an error; I'm saying I can't find anything that will accept this command.

Upvotes: 2

Views: 951

Answers (1)

Ma3x
Ma3x

Reputation: 6549

The physical repository was created locally in the project's folder.

To be able to enter git commands open the Visual Studio Code Integrated Terminal (View | Toggle Integrated Terminal) and type the first command to add the remote repository (also called upstream).

git remote add origin https://github.com/mygitusername/myprojectname.git

Make sure to properly replace the mygitusername and myprojectname parts.

After you do that you can use the VS Code GUI to fetch/pull/push as well.

See: https://code.visualstudio.com/docs/editor/integrated-terminal

Upvotes: 3

Related Questions