I am a Developer Advocate for Security in Mobile Apps and APIs at approov.io.
Another passion is the Elixir programming language that was designed to be concurrent, distributed and fault tolerant.
Location
Scotland
Education
Self teached Developer
Work
Developer Advocate for Mobile and API Security at approov.io
Ok, the above one is more a tip, but a very important command to know about for beginners is git stash --help and git show --help
With git stash we can save our changes that are not commited yet, and if we include -u we will save also the files not tracked. It's useful to clear the workspace or to move code not committed yet to another branch or just to later reuse on the same branch, just by doing git stash apply.
With git show we can see the git diff for the last commit, and with git show <commit-hash> or git show HEAD~3 we see the git diff for that specific point in history.
When things go terrible wrong, like you delete accidentally a branch, you can use git reflog --help to see your history of changes and get back to a good state.
You forgot the most important of all
git checkout -
:It's just like our old Linux friend
cd -
;)Ok, the above one is more a tip, but a very important command to know about for beginners is
git stash --help
andgit show --help
With
git stash
we can save our changes that are not commited yet, and if we include-u
we will save also the files not tracked. It's useful to clear the workspace or to move code not committed yet to another branch or just to later reuse on the same branch, just by doinggit stash apply
.With
git show
we can see thegit diff
for the last commit, and withgit show <commit-hash>
orgit show HEAD~3
we see thegit diff
for that specific point in history.When things go terrible wrong, like you delete accidentally a branch, you can use
git reflog --help
to see your history of changes and get back to a good state.Very useful tips.Thanks a lot, especially for the idea to use git stash apply
Agreed! These are awesome tips. Thank you!