There are so many different git commands out there, even being an experienced developer you could learn new commands everyday! What are some of your favorite and not very well known git commands besides the basics like git push, pull, rebase, merge?
I don't like pushing half-work. So I always stash my work, whenever I have to switch to another branch:
git-stash
Hmm, that's a good question!
Well, one of my favorite commands is: $ git stash save <message>. It keeps the code clean and organized while allowing me to once again return to our undone work.
Also, a recent Git feature allows you to stash specific files by using git stash push <path>, without the need of -p.
git commit --amend -m "I've just commited something I'm ashamed of"
git checkout stash@{0} -- {filename} > {target_file}, or whatever other stash in stack, to extract that file's content from stash. This works with branches too.
git push origin master —force 😁! Lol just kidding!
git log --all --graph --decorate --oneline --simplify-by-decoration
sourcetree ;-)
Not exactly a Git command, but I have so many useful features of Git because they're all listed in menus.
www.sourcetreeapp.com
$ git commit -am "not working yet..." && git push && shutdown -Pt 0 0
Alexi Taylor 🚀
Software Engineer
Created a git alias, 'git yolo' for 'git push --force origin master'.