Be honest: how many times have you Googled "how to undo a git commit"? πŸ˜…

Most of us put #Git Expert on our resumes, but the CLI is still terrifying. That's why we built a completely free tool to help you master it πŸ‘‰ https://www.git-skills.dev/

Test your knowledge with interactive Git quizzes, learn practical Git How-Tos, and stop stressing over merge conflicts.

Go take a quiz & drop your score in the comments! Let’s see who the real Git Masters are πŸ†

#coding #programming #developers #SmartGit

@smartgit

Once.

I now have two aliases in ~/.gitconfig:

uncommit = reset --soft HEAD~1
unadd = reset HEAD

@smartgit just did a few tests, and I got some feedback.

The answer to the question "Which command adds all modified files to the staging area?" is wrong. It's `git add -u`. The proposed answer `git add .` also adds untracked files.

"What is the difference between git fetch and git pull?" The proposed answer "... pull dowload and merge" is not necessarly true. It can download and rebase depending on your config.

1/

@smartgit

I was **very** plasently surprised that you show `git switch` and `git restore`. There is no reason anymore to use the confusing `git checkout` anymore since their introduction. You may understand why I was a bit sad when I saw that the answer for "Which command creates a new branch AND switches to it?" was `git checkout -b feature` (which is technically right but should not be teached anymore) and not `git switch -c feature`.

2/

@smartgit

Likewise, for "You want to merge 'feature' branch into 'main'. Which commands should you run?", why is the expected answer "`git checkout main`, then ...` and not "`git switch main`, then ..."

Likewise, in the question "Which command discards all uncommitted changes in your working directory?", why is the answer `git checkout -- .` and not `git restore .`, especially since `git restore --staged .` is proposed?

3/

@smartgit

It's **very** nice that you present `HEAD~3Μ€` (in the question "What does HEAD~3 refer to?"). Git revisions are not well known, especially `@{1}Μ€` or `some_branch@{1}Μ€`. A link to the [documentation](https://git-scm.com/docs/gitrevisions) in the explanation or the link bellow would have been a plus.

4/4

Git - gitrevisions Documentation

@robinm Thanks for the great feedback! All of your suggestions have now been incorporated.