Skip to content

Git stuff

dickgroenenberg edited this page Oct 19, 2022 · 6 revisions

Definition:
origin = repo on github
master = local clone of repo

Non-disruptive checks:
git fetch
git status
git diff

disruptive:
git pull (because = git fetch + git merge)
git merge

show hash on github:
https://"repo-address"/commit/"hash"

show branch name:
git rev-parse --abbrev-ref HEAD

show differences (hashes) if origin is ahead:
git rev-list master..origin | cat -n

show differences (hashes; changes have to be commited) if local (master) is ahead:
git rev-list origin..master | cat -n

import specific hash(es) from origin to local (master):
git pull origin hash1 (hash2 hash3 ..)

show hash commit message:
git log --format=%B -n 1 <hash>

display name of current branch:
git rev-parse --abbrev-ref HEAD

Clone this wiki locally