Setup Menus in Admin Panel

  • No products in the cart.


Pushing and Pulling Project in Gitlab

The push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repository. It’s the counterpart to git fetch , but whereas fetching imports commits to local branches, pushing exports commits to remote branches.

Pushing your project in gitlab:

1. Create a project name. Here, I have created project name as news_portal.


Fig:Creating project name in gitlab



2. By default it will provide the following command line instructions:

Command line instructions:

Git global setup
git config --global "Ganesh Khadka"
git config --global "[email protected]"
Create a new repository
git clone
cd news_portal
git add
git commit -m "add README"
git push -u origin master
Existing folder
cd existing_folder
git init
git remote add origin
git add .
git commit -m "Initial commit"
git push -u origin master
Existing Git repository
cd existing_repo
git remote rename origin old-origin
git remote add origin
git push -u origin --all
git push -u origin --tags


So, go to the command and set the username and email by typing the command:


git config --global "Ganesh Khadka"
git config --global "[email protected]"



Fig:Setting user name and email

After the successful set up of username and email following the following commands:


1.Go to the existing folder i.e /c/xampp/htdocs/Laravel_Project/news_portal
2.git init
3.git remote add origin
4.git add .
5.git commit -m "Initial commit"
6.git push -u origin master


Screenshot 1:



Screenshot 2:


Then after performing the above command, you have successfully push your project in the gitlab as in the screenshot below:


Fig:Screenshot after pushing a project in gitlab


Now, follow the below command:

git remote -v


After entering the above command you will see the following:

origin (fetch)
origin (push)






If you made some changes in the code then you have to perform the following steps:

1.git add .
2.git commit -m "Changes you made in your code"
3.git push origin master
4.git status



How to clone(or download) project from GitHub or gitlab?


Step 1:

Create a folder name. I have provided folder name newsportal_clone


Step 2:

Open terminal and go to directory /c/xampp/htdocs/Laravel_Project/newsportal_clone

Type the following command:

git clone


Note: is the path which you are going to clone from gitlab.


Screenshot 1:


Screenshot 2:

In this clone project, you have missed some of the folder such as vender,env etc. So, open the project and perform the following steps:

1. Open composer.json file and copy the following code:

php -r "file_exists('.env') || copy('.env.example', '.env');" 


2.Open terminal and type the following command:

cd news_portal 
php -r "file_exists('.env') || copy('.env.example', '.env');"

->This command will create the .env file in your project folder.


3.Then finally update the composer by using the following command:

composer update

It will take a few minutes to update the composer.

Screenshot  1:



Screenshot 2:


Fig:Screenshot of newly created .env,vendor file



dd() :
->It is a laravel function which stops the execution and it will give response to what we have inserted inside dd() function.


Route::get('/', function () {
    return view('welcome');
Route::get('test', function () {
    dd('Hello welcome to laravel!!');

If we run the code:


Then it will show the results:

 Hello welcome to laravel!!


Screenshot 1:


Screenshot 2:


SEE ALL Add a note
Add your Comment

Advanced Course Search Widget

Popular Courses

Course Categories

© PHPhelp. 2002 - 2018 All rights reserved.