Skip to content

Instantly share code, notes, and snippets.

View nagi1's full-sized avatar
✍️
Writing

Ahmed Nagi nagi1

✍️
Writing
View GitHub Profile
@nagi1
nagi1 / rules-to-write-better-commit-messages.md
Created October 13, 2019 12:58 — forked from medhatdawoud/rules-to-write-better-commit-messages.md
This gist is the summary of a video on YouTube [in Arabic] you can watch from here: https://youtu.be/BTlL-LBDCSI

Rules to write a better commit message

These are my preferences for a good commit message, feel free to fork this gist and add your own standards, or add comment here to share yours with the community.

1. Include only the files related to the feature you are implementing:

  • Don't add any file that is not related to the main issue, you can make it in a separate commit.
  • Separating files that not related is important in the revert cases.
  • Revise the whole changes always before committing and make sure to mention each change you made in the message.

2. Commit subject should be concise and reflect the essence of the commit:

  • Imagine the commit as an Email to the owner or your team mates.
  • Subject in the first and main sentence of the commit, it should be concise and to the point.
  • It shouldn't exceed 50 char.
@nagi1
nagi1 / gitignore_per_git_branch.md
Created March 7, 2021 10:23 — forked from wizioo/gitignore_per_git_branch.md
HowTo have specific .gitignore for each git branch

How to have specific .gitignore for each git branch

Objective

My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.

Solution

My solution is to make a general .gitignore file and add .gitignore.branch_name files for the branches I want to add specific file exclusion. I'll use post-checkout hook to copy those .gitignore.branch_name in place of .git/info/exclude each time I go to the branch with git checkout branch_name.

@nagi1
nagi1 / Envoy.blade.php
Created April 18, 2021 20:55
Envoy script to achieve zero downtime deployment. see https://ahmednagi.com/laravel-deploy-bitbucket
@servers(['web' => $user.'@'.$host,'localhost' => '127.0.0.1'])
@setup
// Sanity checks
if (empty($host)) {
exit('ERROR: $host var empty or not defined');
}
if (empty($user)) {
exit('ERROR: $user var empty or not defined');
}
@nagi1
nagi1 / bitbucket-pipeline.yaml
Created April 18, 2021 20:59
Example bitbucket-pipeline.yaml that works with laravel envoy. See https://ahmednagi.com/laravel-deploy-bitbucket
image: php:7.4-fpm
definitions:
steps:
- step: &composer-install
name: Build PHP
caches:
- composer
script:
- ls -al
@nagi1
nagi1 / cloudSettings
Created April 21, 2024 07:43
Visual Studio Code Settings Sync Gist
// Empty
@nagi1
nagi1 / cloudSettings
Created April 21, 2024 07:44
Visual Studio Code Settings Sync Gist
// Empty