This document serves as a handy reference for various useful commands and techniques that can simplify and streamline your development workflow. Whether you're working with large repositories, managing branches, or tracking changes, these commands will help you navigate Git and other tools with ease.
Sparse checkout allows you to clone and work with only a subset of a repository, which is especially useful when dealing with large repositories.
Clone the repository without checking out files:
git clone --no-checkout --depth 1 https://github.com/username/repository.git
Change into the repository directory:
cd repository
Initialize sparse checkout:
git sparse-checkout init --cone
Specify the directories and files you want:
git sparse-checkout set path/to/dir1 path/to/dir2 path/to/file1
Reapply sparse checkout settings:
git sparse-checkout reapply
Checkout the specified files and directories:
git checkout
Check the current status of your repository to see which files are staged, unstaged, or untracked:
git status
docker stop $(sudo docker ps -aq)
# Regardless of their state (running, stopped, or exited).
docker rm $(sudo docker ps -aq)
# same for images
docker rmi $(sudo docker images -q)
docker container prune -f
docker image prune -a -f
docker volume prune -f
docker network prune -f