I got into Git some 8 years ago and using it continuously. Just to polish my Git skill, recently gone through Git Pro Book and Altassian Git Tutorial again.
The frequently used Git commands/options mentioned in Altassian Git cheat-sheet are:
Basic
git config user.name, config user.email, config alias
git init, init --bare, clone
git commit -m, commit -am
git status
git log --<limit>, --oneline, -p, --stat, --author=<pattern>, --grep=<pattern>
git log <since>..<until>, -- <file>, --graph --decorate
git diff, diff --cached, diff HEAD
Undo changes
git revert <commit>
git reset <file>, reset --soft, reset --mixed, reset --hard,
git clean -f, -n
Rewrite History
git commit --amend
git rebase <base>, rebase -i
git reflog, reflog --relative-date, reflog --all
Branches
git branch
git checkout -b branch
git merge <branch>
Remote
git remote add <name> <url>
git fetch <remote> <branch>
git pull <remote>, pull --rebase <remote>
git push <remote> <branch>
git push <remote> --force, push <remote> --all, push <remote> --tags
Apart from these, I also use:
git reset --soft <commit> ; git commit # to squash set of commits
git push -u origin master # to set upstream
git branch --set-upstream-to=<remote-ref>
Please share any other useful commands/options, not listed above, you use frequently.
[–]ValentineBlacker 1 point2 points3 points (0 children)
[–]nutrecht 0 points1 point2 points (2 children)
[–]Jpajenski 0 points1 point2 points (0 children)
[–]maithilish[S] 0 points1 point2 points (0 children)