docs:tips_n_tricks:git:index.html
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
docs:tips_n_tricks:git:index.html [12.05.2023 11:31 CEST] – removed - external edit (Unknown date) 127.0.0.1 | docs:tips_n_tricks:git:index.html [24.03.2024 01:30 CET] (current) – peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Git Cheat Sheet ====== | ||
+ | ---- | ||
+ | |||
+ | Edit your personal data for commits (i.e. name + e-mail address): | ||
+ | EDITOR=< | ||
+ | |||
+ | <code properties Editor content> | ||
+ | # This is Git's per-user configuration file. | ||
+ | [user] | ||
+ | name = <Enter your full real name here> | ||
+ | email = <Enter your E-Mail here> | ||
+ | </ | ||
+ | ---- | ||
+ | |||
+ | Preview((provided your working tree is clean)) '' | ||
+ | |||
+ | git fetch origin master ; git diff -R --stat origin/ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | Preview((provided your working tree is clean)) '' | ||
+ | |||
+ | git fetch origin master ; git diff -R --diff origin/ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | Show committs across branches: | ||
+ | git log --all --stat | ||
+ | |||
+ | ---- | ||
+ | |||
+ | Show all commits with some ascii art drawings showing branches and the like: | ||
+ | git log --all --stat --graph | ||
+ | |||
+ | Same, but only for branches, tags and remotes, excluding //stash// and others: | ||
+ | git log --branches --tags --remotes --stat --graph | ||
+ | |||
+ | __Further reading: | ||
+ | |||
+ | ---- | ||
+ | Format list of branches to your liking: | ||
+ | |||
+ | git branch --list --format ' | ||
+ | |||
+ | will (up to colours) produce the same format as default | ||
+ | |||
+ | __Further reading:__ '' | ||
+ | |||
+ | ---- | ||
+ | **Reading branch descriptions** seems not to be implemented. Branch description seem to be config item and can be read out by | ||
+ | |||
+ | git config --get " | ||
+ | |||
+ | __Reference__: | ||
+ | __Workaround__: | ||
+ | |||
+ | Branch description can bee **created or changed** (and thus been seen also) by: | ||
+ | |||
+ | git branch --edit-description <branch name> | ||
+ | |||
+ | ---- | ||
+ | Find commits which are in one branch, but not in //main//: | ||
+ | |||
+ | git log <my branch> ^main | ||
+ | |||
+ | ---- | ||
+ | Delete remote branches: | ||
+ | |||
+ | git push [--dry-run] < | ||
+ | |||
+ | ---- | ||
+ | Reset file to any version from < | ||
+ | |||
+ | git checkout < | ||
+ | |||
+ | ---- | ||
+ | Show full contents of file < | ||
+ | |||
+ | git show < | ||
+ | |||
+ | __Credits__: | ||
+ | ---- | ||
+ | |||
+ | {{entry> |