Cheatsheets.

Pacman Cheatsheet

Command

Function

pacman -Fy

Refresh file database for installed packages.

pacman -Q

Query installed packages.

pacman -Q --info <package>

Display detailed information about a package.

pacman -Q --queryformat '%n %v'

List all installed packages along with their respective versions.

pacman -Qd

List packages installed as dependencies.

pacman -Qdt

List orphaned packages.

pacman -Qe

List explicitly installed packages.

pacman -Qi <package>

Display detailed information about an installed package.

pacman -Qk <package>

Check integrity of package files.

pacman -Ql <package>

List all files installed by a package.

pacman -Qm

List all foreign packages not in the official repositories.

pacman -Qm --qverif

List all foreign packages and verify their integrity.

pacman -R <package>

Remove package from the system.

pacman -Rns <package>

Remove a package and its unused dependencies.

pacman -Rns $(pacman -Qdtq)

Remove all orphaned packages and their unused dependencies.

pacman -Rs <package>

Remove package and its dependencies not required by other packages.

pacman -S --asdeps <package>

Install package as dependency.

pacman -S --needed <package>

Install package only if not already installed.

pacman -S --needed $(pacman -Slq <repository>)

Install all packages from a specific repository that are not already installed.

pacman -S <package>

Install package from the repositories.

pacman -Scc

Clear the package cache (use with caution).

pacman -Scc --noconfirm

Clear the package cache without prompting for confirmation (use with caution).

pacman -Ss <search_term>

Search for a package in the repositories.

pacman -Su

Update the system without refreshing package database.

pacman -Sw <package>

Download package without installing it.

pacman -Sy <package>

Update the package database and install package.

pacman -Sy <package> --noconfirm

Update the package database and install package without confirmation.

pacman -Syu

Synchronize package databases and update system.

pacman -Syu --ignore <package>

Update system while ignoring a specific package.

pacman -Syu --noconfirm

Update system without prompting for confirmation.

Git Cheatsheet

Command

Function

git init

Initialize a new Git repository.

git clone <repository>

Clone an existing repository into a new directory.

git status

Show the working tree status, including staged, unstaged, and untracked files.

git add <file>

Stage changes in the specified file for the next commit.

git add .

Stage all changes in the current directory for the next commit.

git commit -m "<message>"

Commit staged changes with a descriptive message.

git commit -a -m "<message>"

Commit all changes (tracked files) with a message, skipping the staging step.

git log

Show the commit history for the current branch.

git log --oneline

Show a simplified commit history with one line per commit.

git diff

Show changes between the working directory and the index (staged changes).

git diff <commit>

Show changes between the working directory and a specific commit.

git checkout <branch>

Switch to the specified branch.

git checkout -b <new-branch>

Create a new branch and switch to it.

git merge <branch>

Merge the specified branch into the current branch.

git branch

List all branches in the repository.

git branch -d <branch>

Delete the specified branch (only if it has been fully merged).

git remote -v

Show the remote repositories associated with the local repository.

git push <remote> <branch>

Push local changes to the specified remote branch.

git pull <remote> <branch>

Fetch and merge changes from the specified remote branch into the current branch.

git fetch <remote>

Fetch changes from the remote repository without merging.

git reset <file>

Unstage a file, keeping the changes in the working directory.

git reset --hard <commit>

Reset the working directory and index to a specific commit, discarding all changes.

git stash

Stash the current changes in the working directory for later use.

git stash pop

Apply the most recent stashed changes and remove them from the stash.

git tag <tag-name>

Create a new tag for the current commit.

git show <tag-name>

Show details about a specific tag.