Git cheat list¶
list of all affected files both tracked/untracked (for automation)
1 |
|
name of the current banch and nothing else (for automation)
1 |
|
all commits that your branch have that are not yet in master
1 |
|
setting up a character used for comments
1 |
|
fixing fatal: Could not parse object
after unsuccessful revert
1 |
|
view diff with inline changes (by lines)
1 |
|
view diff of changes in a single line file (per char)
1 |
|
view quick stat of a diff
1 2 3 |
|
undo last just made commit
1 |
|
list last 20 hashes in reverse
1 |
|
list commits between dates
1 |
|
try a new output for diffing
1 2 |
|
enable more thorough comparison
1 |
|
restoring a file from a certain commit relative to the latest
1 |
|
restoring a file from a certain commit relative to the given commit
1 |
|
restoring a file from a certain commit
1 |
|
creating a diff file from unstaged changes for a specific folder
1 |
|
applying a diff file, go to the root directory of your repository, run:
1 |
|
show differences between last commit and currrent changes:
1 |
|
referring to:
- last commits
... HEAD~1 ...
- last 3 commits
... HEAD~3 ...
show the history of changes of a file
1 |
|
ignoring whitespaces
1 |
|
pulling for fast-forward only (eliminating a chance for unintended merging)
1 |
|
- list of all tags
1 2 |
|
archive a branch using tags
1 2 |
|
you can delete your branch now
get a tagged branch
1 |
|
list of all branches that haven’t been merged to master
1 |
|
enable more elaborate diff algorithm by default
1 |
|
list of all developers
1 |
|
display graph of branches
1 |
|
or
1 |
|
remembering the password
1 2 |
|
the first command tells git to remember the credentials that you are going to provide for the second command
path to the global config
1 |
|
example of a global config
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
viewing differences between current and other branch
1 |
|
viewing differences between current and stash
1 |
|
viewing differences between several commits in a diff tool
1 |
|
view all global settings
1 |
|
delete tag
1 2 |
|
pushing tags
1 |
|
checking the history of a file or a folder
1 |
|
disabling the scroller
1 |
|
who pushed last which branch
1 |
|
deleting remote branch
1 |
|
deleting remote branch localy
1 |
|
or to sync with the remote
1 |
|
deleting local branch
1 |
|
list actual remote branchs
1 |
|
list all remote (fetched) branches
1 |
|
list all local branches
1 |
|
find to which branch a given commit belongs
1 |
|
updating from a forked repository
1 2 3 |
|
add gitignore, stop tracking some ignore files
1 2 |
|