99% of the programmers only know the basic git commands (push, pull and commit) These 10 git commands will save you hours of research time when you're stuck:
Pull from remote overwriting local changes. i) git stash (revert and stash changes locally) ii) git pull (pull from remote normally) tip: to retrieve changes, do 'git stash apply'
@ujjwalscript A lot of these commands are totally new to me. So needless to say, lots to learn. I specially like commands that combine multiple flags in one command like git commit -am 'message' An excellent read this was. Thanks for sharing bhaiya!
@ujjwalscript Thanks for sharing these git commands. Having a good understanding of git really helps
@ujjwalscript These commands are so useful 💯 This will surely help many devs! 😊
@ujjwalscript Great thread! Knowing these commands are must for every developer😊🙌
@ujjwalscript Great thread Thanks for sharing this Ujjwal. Git is most powerful tool we're using as a developer.
@ujjwalscript These are awesome commands @ujjwalscript. I would like to add few more in this loop. 1. To modify the most recent commit message -> git commit --amend 2. To add more changes in last commit (before push) without changing the commit message -> git commit --amend --no-edit
@ujjwalscript Ohh and: git rebase -i Learning how to keep your commit history clean is the best way to learn GIT :). Besides I think the most useful commands to save time (in writing) are git aliases. And please, let's not forget about: git push --force-with-lease
@ujjwalscript Ohmygod major thanks to you, git is one thing I always struggle with, you have sorted my problems
@ujjwalscript Honestly I've been only using, pull, add, commit and push most frequently. These are quite helpful. 🚀 Your threads always teach something new. ❤️
@ujjwalscript Git bisect is great one for finding in which commit a bug happened
@ujjwalscript Switch to an existing branch: git switch branch-name Switch with -c to create a new branch: git switch -c branch-name Switch to the previous branch with dash, just like with cd: git switch -
@ujjwalscript Add git reflog to the list as well. Comes in handy when you want to reset a reset.
@ujjwalscript Best and useful git commands, this will surely useful for Developers!!
@ujjwalscript I don't even know anyone, vs code handles all my git operations
@ujjwalscript These surely a very useful commands, Great share Ujjwal as always ++ git reset --soft HEAD^n This command retain the changes and now if you do git status will show the changes as staged But if you want to get rid of changes as well, you have to do git reset --hard HEAD^n
@ujjwalscript Replace this thread with one word - lazygit
@ujjwalscript Replace this thread with one word - lazygit
@ujjwalscript Git is a tool that if you master, all of your areas as a developer are improved.