4

How to configure VS Code to work with git? I'm using the standard scm provider in VS Code. I installed git on my pc, initialized the repository in a folder, made some changes and VS shows that it has been committed but I don't see in on my github, and when I want to pull from git VS shows "Your repository has no remotes configured to pull from."

3
  • 1
    What's the output of git remote -v? It sounds like you haven't pushed any changes to the remote. Commented Feb 2, 2018 at 19:13
  • nothing outputted Commented Feb 2, 2018 at 19:28
  • 1
    In that case, see @dstrants's answer. Your remote is not configured. (this is something that will automatically be set up when cloning a repo from a remote in the future). Commented Feb 2, 2018 at 19:30

2 Answers 2

6

You first need to add your GitHub repo as a remote! To do this you can follow the Official Guide.

git remote add origin https://github.com/user/repo.git
#optionals below just to verify
git remote -v
origin  https://github.com/user/repo.git (fetch)
origin  https://github.com/user/repo.git (push)

Then you can push your local commits with official guide

git push -u origin master

You can add remote directly from VS Code as introduced here

Sign up to request clarification or add additional context in comments.

7 Comments

I typed git remote add origin github.com/myUserName/myRepoName.git in the integrated terminal in VS. Now it shows on git remote -v: origin github.com/myUserName/myRepoName.git (fetch) origin github.com/myUserName/myRepoName.git (push) but still no my repo on my github
You have to use the link to your own repository instead of the sample link github.com/myUserName/myRepoName.git
I initialized it. Then typed: <br> git remote add origin github.com/myUserName/myRepoName.git <br> git push -u origin master <br> It shows that repository not found
You have initialized the repo locally. You just have to do some short of the same thing on the remote repo and get the appropriate link. Just follow these steps
Aaargh, finally got it, Thank you so much! Is it possible to create repo via the integrated terminal in VS without going to github directly?
|
0

You need to push your local commits to your remote. Check out Git Status Bar Actions and Remotes.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.