Git cheat sheet



Yüklə 83,28 Kb.
Pdf görüntüsü
səhifə3/3
tarix29.11.2023
ölçüsü83,28 Kb.
#140295
1   2   3
GitHub - GIT CHEAT SHEET

TEMPORARY COMMITS
Temporarily store modified, tracked files in order to change branches
git stash
Save modified and staged changes
git stash list
list stack-order of stashed file changes
git stash pop
write working from top of stash stack
git stash drop
discard the changes from top of stash stack
REWRITE HISTORY
Rewriting branches, updating commits and clearing history
git rebase [branch]
apply any commits of current branch ahead of specified one
git reset --hard [commit]
clear staging area, rewrite working tree from specified commit
INSPECT & COMPARE
Examining logs, di

s and object information
git log
show the commit history for the currently active branch
git log branchB..branchA
show the commits on branchA that are not on branchB
git log --follow [file]
show the commits that changed file, even across renames
git diff branchB...branchA
show the di

of what is in branchA that is not in branchB
git show [SHA]
show any object in Git in human-readable format
IGNORING PATTERNS
Preventing unintentional staging or commiting of files
git config --global core.excludesfile [file]
system wide ignore pa
tt
ern for all local repositories
logs/
*.notes
pattern*/
Save a file with desired pa
tt
erns as 
.gitignore
with either direct string 
matches or wildcard globs.

Yüklə 83,28 Kb.

Dostları ilə paylaş:
1   2   3




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə