Git

Table of Contents

1. Description

Notes about Git

2. Commands

2.1. Show only names of changed files

git diff --staged --name-only

2.2. Show the difference without context

git diff --unified=0

2.3. Show untracked files

git ls-files --others

2.4. Search commits history for the string foo

2.5. Interactively choose hunks to add

git add --patch <filename>

2.6. Make patch foo.patch with work tree diff

git diff > foo.patch

2.7. Apply patch foo.patch

See also notes:patch

git apply foo.patch

2.8. List contributors

git shortlog -sn --since="2 years ago"

2.9. List amount of commits per year

git log --pretty=format:"%ad" --date="format:%Y" | sort | uniq -c

3. Git server

4. Related nodes

5. References

lun. 11 mai 2026

Generated with Emacs 30.1 (Org mode 9.7.11)