Git
Table of Contents
- 1. Description
- 2. Commands
- 2.1. Show only names of changed files
- 2.2. Show the difference without context
- 2.3. Show untracked files
- 2.4. Search commits history for the string
foo - 2.5. Interactively choose hunks to add
- 2.6. Make patch
foo.patchwith work tree diff - 2.7. Apply patch
foo.patch - 2.8. List contributors
- 2.9. List amount of commits per year
- 3. Git server
- 4. Related nodes
- 5. References
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
git log -S 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