Skip to content

Instantly share code, notes, and snippets.

@isaumya
Last active August 9, 2023 15:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaumya/5ad264fbbe64b852bddec40c6c0a3cb2 to your computer and use it in GitHub Desktop.
Save isaumya/5ad264fbbe64b852bddec40c6c0a3cb2 to your computer and use it in GitHub Desktop.
Add repo to VS Code Projects

Add Git Repo to your CLI created project in VS Code

Let's say that you have created a project using @vue/cli or some other cli locally. Now you created a github repo. Also at the time of creating the repo you have set the LICENSE file from the web creation portal. Now if you are using VS Cose, here are the following commands that you need to run for the first time to ensure the remote repo gets properly connected with your project.

Step 1. Add Remote Repo URL

git remote add origin https://<AccountName>.github.com/somerepo.git

Step 2. Pull from the Remote Repo with --allow-unrelated-histories flag

git pull origin master --allow-unrelated-histories

Step 3. Push your project files to your Repo for the first time

git push -u origin master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment