4 ms·
Git comes down to knowing 6 commands... and you don't need to even need to be an expert with all 6. If can grasp the following 6 commands, you will know about 9
by thrownaway954 9y ago
Git comes down to knowing 6 commands... and you don't need to even need to be an expert with all 6. If can grasp the following 6 commands, you will know about 99% of every day uses of git:
git add .
git commit -m "my commit message"
git merge my_feature_branch | or my personal favorite: git merge --squash my_feature_branch
git rebase my_feature_branch
git log
git checkout -b my_feature_branch
- reificator 9y agoI don't know - cloning, pushing, pulling, and arguably fetching are all part of a normal workflow with git. You're up to 9-10 commands now.
- tjr225 9y agountil you accidentally use rebase to squash commits and accidentally squash the wrong commits...
- iooi 9y agothen just run `git reflog` to go back to the commit before you rebased
- AlexCoventry 9y agoreflog is really out in the tail of git commands you ought to know to use it effectively, though. I'd say you're at much more than six commands at that point.
- recursive 9y agoI never use log or rebase. I do use push, pull, and checkout. I guess everyone has a different 99%.
- kccqzy 9y agoI don't know. I just grepped my own shell history, selecting those lines that start with git and printed the first two words. Even removing those commands that I use just once or twice, I have a much longer list than yours. Here are mine that are not mentioned by you: git cherry-pick git shortlog git push git pull git fetch git stash git branch git diff git blame git show git reset git help
- wokwokwok 9y ago...but do you actually need to understand all of those to use git? I doubt it. Pull, push, branch, diff perhaps? I know people who have been using git for years and they never bisect, cherry-pick or stash. Heck, I was talking to a guy yesterday who asked how to push a tag to a remote branch; he'd literally never had to do that before. I'm just saying, you don't have to use (or know how to use) all the tools in the toolbox to be able to use any of them. /shrug