Today I will show you how to use git to push a laravel project onto github
Start.
Step 1: Create a laravel project.
https://medium.com/@larahelp/restful-api-in-laravel-5c1389c58ca0
You go to the link and read to create project laravel.
Step 2: Install Git
https://git-scm.com/downloads
You go to the link above to download and install git.
Step 3: Create an account on Github.
https://github.com
You go to the link above to create a github account
Step 4: Create a repository on Github.
Step 5: Push to GitHub
Now that we have created the repository, we will now push the project to git. Follow the steps below to do it:
1. Open git bash in laravel project directory
2. In git bash, enter the following command
Initialize the project first:
1 2 | git init |
Add files to git:
1 2 | git add . |
Commit changes by message
1 2 | git commit -m 'Added REST Api' |
Add the remote origin where the project will be pushed
1 2 | git remote add origin https://github.com:larahelp/RestApi.git |
Last but not least, push it into the github
1 2 | git push -u -f origin master |
And the repository is added to your git account. Now you can copy the repository anywhere with git
Good luck
The article is brief and translated from: https://medium.com/@larahelp/connecting-the-laravel-project-on-github-73acf55bbd63