git notes show <commit>Displays the note text attached to a specific commit.
git fetch --dry-runPreview remote changes without actually downloading them.
git show-ref --headsShow commit hashes and reference names for all local branches.
git count-objects -vPrints counts and disk usage of loose and packed objects in the repository.
git branch --mergedList local branches fully merged into the current branch.
git bisect stopStops the bisect session and restores the repository to its original state.
git reflogShow a log of all Git references
git fetchDownload new commits, branches, and tags from the remote without changing your current files.
git checkout -b <branchname>Create a new branch and switch to it
git branch -m <old_branchname> <new_branchname>Rename a branch
git branch -vList all branches including commit information
git rebase <branchname>Replay your current branch’s commits on top of another branch to create a cleaner, linear history.
git checkout -b <branchname1> <remote>/<branchname2>Clone a remote branch and switch to it
git restore --stagedRemoves files from the staging area without altering their content in the working directory.
git checkout <branchname>Switch to a different branch
git branch -M <branchname>Forcefully rename the current branch to <branchname>
git branch <branchname>Creates a new branch with the specified name.
git merge <branchname>Merge the specified branch into the current branch, combining their histories.
git rm <path>Remove a file from the working directory and staging area.
git diff <commit> --name-onlyShow only the names of files that changed compared to a specific commit.
git add <path>Stages changes in the specified <path> so they are included in the next commit.
git rm --cached <path>Remove files only from the git index
git commit -m "<message>"Create a new commit with the staged changes and attach a message describing them.
git clone <repo_url>Download a remote Git repository to your local machine as a new directory.
git logShow the commit history
git blame <path>Show who last changed each line of a file and in which commit.
git pullFetch and merge remote changes
git initInitialize a Git repository in the current directory
git statusShow the status of the current repository
git diff HEADShow uncommitted changes
git add -AAdd all new and changed files to the staging area
git branchList all branches
git branch -d <branchname>Delete a branch
git push Upload local commits from your current branch to its configured remote branch.
git config pull.rebase falseConfigures Git to merge instead of rebasing when pulling changes.
git diff @{push}Compare your working directory to the commit recorded at your last push
git log --all --grep=<searchterm>Display all commits across branches whose message contains a specified keyword.