Inspect Git configuration and remote URLs
git config --list
git remote show origin
git config --get remote.origin.urlwebsite·Indexed 29 days ago
https://rashedmakkouk.github.io/dev-toolboxA collection of development guides, DevOps templates, and best practices covering Git, GitLab, Kubernetes, Docker, Nginx, TypeScript, and OS-specific configurations for Windows, Linux, and WSL 2.
git config --list
git remote show origin
git config --get remote.origin.urlcat /etc/*release
lsb_release -a
cat /etc/debian_version
uname -mrs
# Extracting specific ID and NAME from os-release
source /etc/os-release
echo $ID
echo $NAMEFollow these rules when writing commit messages to ensure consistency and clarity:
Summary: as the header for blocks listing specific commit changes.Changelog: as the header for blocks listing changes that must be included in the CHANGELOG.md file.type prefix.type.npm install -g yarnshell:startup# 1. Clone the external repository to a local directory
git clone <repo-url> <package>
cd <package>
# 2. Rewrite history to move all files into the target monorepo path
export TARGET_DIR="packages/<package>"
git filter-branch --prune-empty --tree-filter '
mkdir -p "$TARGET_DIR"
git ls-tree --name-only $GIT_COMMIT | xargs -I files mv files "$TARGET_DIR"
'Note: The --prune-empty flag is used to remove commits that become empty as a result of the history rewrite.
To maintain a scalable Nginx setup, use the following directory structure within the conf/ folder:
conf/bases: Centralized, reusable common configurations and server block best practices.conf/upstreams: Definitions of hosts used for proxying requests and load balancing. These are referenced in server blocks via the proxy_pass key within a location block.conf/sites-available: Inactive server block templates (e.g., domain.com.conf for production, http-to-https.conf for SSL redirection, and non-to-www.conf for WWW redirection).conf/sites-enabled: Active server blocks currently being loaded by the Nginx root config (e.g., domain.dev.conf for development)./mnt/ and mount the device using the appropriate filesystem type (e.g., ext2).# Create directory to map disk to
mkdir /mnt/<dirname>
# Mount disk to directory
mount -t ext2 /dev/sdb /mnt/<dirname>-- Create new database user
CREATE USER 'username'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT ALL ON *.* TO 'username'@'%';
FLUSH PRIVILIGES;# Export database dump to host file
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore database dump from host file
docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE < backup.sqlTo transfer multiple issues from a local repository to a target repository, use a combination of gh issue list to retrieve issue numbers and xargs to execute the gh issue transfer command for each issue.
The command retrieves the issue numbers in JSON format, parses them using jq, and pipes them into the transfer command.
gh issue list -s all -L 500 --json number --jq '.[].number' | \
xargs -I % gh issue transfer % <target-repository>Follow the Conventional Commits specification for structured commit messages: <type>[optional scope]: <description>.
Common types include:
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Formatting/white spacerefactor: Code change that neither fixes bug nor adds featureperf: Performance improvementtest: Adding/correcting testschore: Build process/auxiliary toolsci: CI configurationbuild: Build system/external dependenciesBreaking changes are indicated by a ! suffix on the type or by using the BREAKING CHANGE: footer.
# Example Breaking Change
refactor!: Breaking change message
# Example with footer
fix!: New feature message
BREAKING CHANGE: Breaking change message