l5870uoo9y
I have these Git shortcuts stored in my .zshrc file:

# https://stackoverflow.com/questions/4298960/git-add-a-git-co...

git config --global alias.ac '!git add -A && git commit'

git config --global alias.acm '!git add -A && git commit -m'

git config --global alias.ll '!git log --graph --full-history --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"'

git config --global alias.gst '!git status'

git config --global alias.gca '!git commit -a --amend'

git config --global alias.gp '!git push origin HEAD'

git config --global alias.bd '!git branch -d'

git config --global alias.bdd '!git branch -D'

git config --global alias.mc '!git diff --name-only --diff-filter=U'

git config --global alias.co '!git checkout'

git config --global alias.po '!git push origin'

git config --global alias.cp '!git add -A && git commit -m "Content" && git push'

Out of those, I only – but often – use `git acm` and `git co` and `git po`.

Edit: formatting (oh dear).

TheHippo
Nothing about the content of the site, but please stop determining the language of the user based on geolocation. If the browser says he wants English, serve English.
talkingtab
I'm one of those "I don't want to read the manual" people and have long used git. However, this was very helpful to easily understand some cargo-cult things I was doing. Shame on me! And thank you!
leetrout
I also recommend an alias like this (and l5870uoo9y has other examples and how to set them as git aliases)

  alias gitlg="git log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n''          %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit"
From http://stackoverflow.com/questions/1057564/pretty-git-branch...
actinium226
It seems whenever I show someone this site, they're like "oh this is cool!" and never look at it again.

I wonder if there's something about it that makes it forgettable? I don't know if I can present it any differently, maybe there's a better way of presenting it to make it more appealing.

cryptonector
Git _is_ branching. Every clone is a[n unpublished] branch.
hnuser123456
Why do the arrows point backwards? (I get it points to the parent, but I'd rather point forward chronologically, any commit history viewers that allow this?)
neves
This is an excellent resource. The animations really help to understand Git concepts. I successfully used it for an internal Git course.
codingminds
Sadly I'm not able to enter any command. Even after disabling the ad blocker
srameshc
This is really great resource for someone getting started to understand what's going on. I see many have issues and try out different git commands without understanding the outcome.
sakesun
I've finished all levels of the tutorial several times. Yet when in real work, I'm still often struggle with git. :(
lainga
Has anyone used `git describe` in anger?
kwar13
Love this tutorial. Thanks!
Gepsens
Sharing a few of my own :

# https://github.com/Igosuki/dotfiles/blob/master/git/.gitconf...

grep = grep -Ii

lalias = "!git config -l | grep alias | cut -c 7-"

done = "!f() { git branch | grep "$1" | cut -c 3- | grep -v done | xargs -I{} git branch -m {} done-{}; }; f"

assumed = "!git ls-files -v | grep ^h | cut -c 3-"

lasttag = describe --tags --abbrev=0

lt = describe --tags --abbrev=0

dr = "!f() { git diff "$1"^.."$1"; }; f"

lc = "!f() { git ll "$1"^.."$1"; }; f"

diffr = "!f() { git diff "$1"^.."$1"; }; f"

lb = " !f() { git branch -a | more; }; f"

cp = cherry-pick

st = status -s

cl = clone

ci = commit

br = branch

diff = diff --work-diff

dc = diff --cached

r = reset

r1 = reset HEAD^

r2 = reset HEAD^^

rh = reset --hard

rh1 = reset --hard HEAD^

rh2 = reset --hard HEAD^^

sl = stash list

sa = stash apply

ss = stash save

logtree = log --graph --oneline --decorate --all

lmine = "!f() { git log --branches [email protected]; }; f"

purgeforever = "!f() { git filter-branch --prune-empty -d /dev/shm/scratch --index-filter "git rm --cached -f --ignore-unmatch $1" --tag-name-filter cat -- --all }"

updaterefsafterpurge = "f() { git update-ref -d refs/original/refs/heads/master; git reflog expire --expire=now --all; git gc --prune=now }"

ec = config --global -e

up = !git pull --rebase --prune $@ && git submodule update --init --recursive

cob = checkout -b

cm = !git commit -m

save = !git add -A && git commit -m 'SAVEPOINT'

wip = !git add -u && git commit -m "WIP"

undo = reset HEAD~1 --mixed

amend = commit -a --amend

wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard

bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -r git branch -d; }; f"

bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"

        pr = pull --rebase
I'd advise binding things like pr, po, cp, --rebase, --continue, to keyboard shortcuts though if you are in an IDE.
dev1ycan
great tutorial!
mediumsmart
excellent tutorial, thank you for that.
DavidWoof
One of my biggest pet peeves about modern development is just how many people don't know jack about git even though they use it every day. It really annoys me when I see a pull request with 20 random commits (with messages like "temp" or "checkpoint") or when people merge main into their personal feature branch instead of just rebasing their branch (yes, sometimes that's not right, but I'm not talking about the corner cases).

I always think about using "clean up a pull request" as a fizzbuzz-ish screen in interviews. It just seems like a decent proxy for "do you care at all?".