Home > Article > Development Tools > How to deploy vue project in github
If you have created a repository on GitHub and want to use Vue to build your application, the next steps will show you how to configure your project so that you can make it compatible with GitHub.
First, you need to create a new project using Vue CLI. You can use the following command:
vue create my-project
This will create a new project called my-project.
Next, you need to install the necessary dependency packages. You can use the following command:
cd my-project npm install
Once completed, you can run the following command to start the project:
npm run serve
Next, you need to create a GitHub repository for this project. Open https://github.com and log in to your account. Click the plus sign in the upper right corner and select "New repository".
In the new warehouse page, you need to set the name and description. You can choose to make your repository public or private. Finally, click the "Create repository" button. Your new repository has now been created successfully.
Now, you need to associate your local project with the new GitHub repository. In the terminal, enter the following command:
git remote add origin https://github.com/username/my-project.git
In the command, replace username with your GitHub username and my-project with the name of your new repository.
Then, run the following command to create your first commit:
git add . git commit -m "first commit" git push -u origin master
This will push your local code to the GitHub repository.
Now, your project has been uploaded to GitHub. You can always make changes locally and then use the following command to push the changes to the remote repository:
git add . git commit -m "my changes" git push
If you want to download an existing project from GitHub, you can use the following command:
git clone https://github.com/username/my-project.git
In the command, replace username with your GitHub username and my-project with the warehouse name.
To summarize, the above steps guide how to use the Vue CLI to create a new project and upload it to a GitHub repository. It also briefly explains how to download existing projects from GitHub. If you need more in-depth operations, you can refer to the Vue CLI or Git official documentation.
The above is the detailed content of How to deploy vue project in github. For more information, please follow other related articles on the PHP Chinese website!