Should I create a new Git branch locally or on GitHub first?

It’s generally better to create a new Git branch locally first and then push it to GitHub. Here’s why:

1. Create the Branch Locally First

Creating a branch locally gives you full control and flexibility before sharing it with others. The workflow typically looks like this:

Create the branch locally: git checkout -b new-branch-name Work […]

Read More

Vite assets are still localhost on production server

If you are using vite.js (for example when using Laravel assets bundler) then running the npm run build command triggers the build process for your project. When you run this command, Vite.js will perform several tasks to prepare your application for production deployment.

If you use Git and upload/deploy your files to production server and you

[…]

Read More

Should I create Git repository in public_html or different folder?

It is generally not recommended to create a Git repository directly inside the `public_html` folder of your web server. The `public_html` (or `public` or `www`) directory is typically the web server’s root directory, and its contents are accessible to the public through the internet. Placing your Git repository there could expose sensitive information and potentially

[…]

Read More

How to display all the committed files in Git repository

Here are few ways to display all committed files in Git repository.

The command will list all the files currently being tracked under the branch master git ls-tree -r master --name-only

List files of the current branch git ls-tree -r master --name-only

show all of the tracked files that have been committed (on the current

[…]

Read More