This articles teaches you how to connect or upload your Laravel project in Git source control.
This tutorial assumes that you have a laravel installed on your machine and created your first laravel application or you have existing laravel application on your machine. If not you can view it in here: Installation of Laravel
First we need to install the git on your machine:
git init command will initialize your directory as local repository
git add . command will add all your files to the staging environment (ready for the next commit)
git commit -m command will add a message or description of your current commit
git remote add origin command will connect your local repository to your remote repository
git push command will push all your commits to the remote repository
To verify that all your files is successfully uploaded to Github, go to: https://github.com/yourusername/myweb.git
myweb is your repository name
This tutorial assumes that you have a laravel installed on your machine and created your first laravel application or you have existing laravel application on your machine. If not you can view it in here: Installation of Laravel
First we need to install the git on your machine:
- Download Git in their official website.
- Install Git on your machine
- After installation is finish, verify the installation is success by opening command prompt (cmd) then type: git --version
- And you will see this: git version 2.13.3.windows.1
After we successfully installed git on your machine. We need to create a repository online (remote), where we will put our project:
After we successfully created our remote repository we will now push/upload our laravel application to our remote repository:
- Go to Github or any web-based hosting service for version control (Bitbucket, Gitlab).
- Login or Register to gain access on their web-based hosting service.
- Create a new repository by clicking the New Repository button or by going to this link: https://github.com/new
- Name the repository any name you want, in this case we will name this as myweb
- Click the Create Repository button, you will see an empty repository with instruction on how to upload your files into github.
After we successfully created our remote repository we will now push/upload our laravel application to our remote repository:
- Open command prompt (cmd) and go to your laravel directory ex. cd c:\myweb
- Run this commands to initial and push your laravel application to your remote repository (Github):
git init git add . git commit -m "first commit" git remote add origin https://github.com/yourusername/myweb.git git push -u origin master
git init command will initialize your directory as local repository
git add . command will add all your files to the staging environment (ready for the next commit)
git commit -m command will add a message or description of your current commit
git remote add origin command will connect your local repository to your remote repository
git push command will push all your commits to the remote repository
To verify that all your files is successfully uploaded to Github, go to: https://github.com/yourusername/myweb.git
myweb is your repository name
Comments
Post a Comment