Working with an existing Project on GitHub

Cloning the Code

<aside> 💡

To contribute, fork the repository on GitHub by navigating to the GitHub page for the original repository and clicking the fork button, then clone and set up your forked copy using the new forked repository URL

image.png

</aside>

git clone [RESPOSITORY-URL]

Setup

  1. Install the dependencies using composer and npm . Keep in mind you have to be in the repository directory

    composer install
    npm install
    
  2. Copy .env.example into a new .env file

  3. Do the necessary adjustments in the .env file for parameters such as DB_HOST , DB_PORT , DB_DATABASE , DB_USERNAME and DB_PASSWORD

  4. Generate new encryption keys for APP_KEY parameter

    php artisan key:generate
    
  5. Set up the database using DBMS of choice, such as phpMyAdmin or direct SQL on your database

    CREATE DATABASE [DB_DATABASE];
    
  6. Run migrations to create tables

    php artisan migrate
    
  7. Run the project

    composer run dev
    

Creating a New Branch

In git code is stored in branches with one primary branch usually named main or master . When a new branch is created, it copies the code from where it was branched off of (e.g. main ). Your commits apply to the active branch. Branches can be merged, such as merging a feature branch with main .

git branch [BRANCH-NAME] 
git checkout [BRANCH-NAME]
git commit -am [COMMIT-MESSAGE]
git push origin [BRANCH-NAME]
git checkout main
git merge [BRANCH-NAME]

Pull Requests