Search code examples
gitvue.jsvue-clivue-cli-3

generate project for existing repository


When creating new Vue projects I use the Vue CLI (terminal). I run vue create projectName and get a local repository (with git files) generated.

When I have existing projects e.g. on Github this repository would have the following path

https://github.com/user/projectname.git

For now I clone this empty repository, generate a new one with the Vue CLI and move all the files from the local repository to the Github repository. After that I can delete the local one.

Is there a way to generate a new project and push the required files directly to an existing repository?


Solution

  • You can add your existing github repository to remotes for your local repo via executing this

    git remote add origin git@github.com:USERNAME/PROJECT.git

    After it you can push existing commits to remote repo git push origin master