GIT
GIT
Configure tooling
Configure user information for all local repositories
$ git config --global color.ui auto
git add -p: Adds files interactively, prompting you for confirmation on each file.
git add -u: Updates tracked files in the staging area to match the working
directory (useful for quick changes).
git add -N: Adds a file as it is, even if it has been modified by other branches.
git add --patch: Stages specific parts of a file using patch selection.
Unstaging Files:
git reset HEAD [file]: Unstages a file from the staging area without affecting the
working directory.
git rm [file]: Removes a file from the staging area and the working directory (be
careful!).
Git Logs -
Basic Usage:
git log: Shows the commit history of the current branch, starting with the most
recent.
git log -n [number]: Limits the displayed commits to the last number.
git log --oneline: Presents each commit on a single line, offering a compact
overview.
git log --graph: Visualizes the commit relationships with a helpful branch diagram.
git log --decorate: Adds branch and tag information to each commit.
Filtering Commits:
git log --author [name]: Shows only commits made by a specific author.
git log --since [date]: Displays commits made after a particular date.
git log --until [date]: Shows commits made before a specific date.
Interactive Exploration:
git log -p: Review commit changes interactively, allowing patch selection.
git log --follow [file]: Track how a specific file has changed across commits.