Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



I 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


...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


I 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.


I never use log or rebase. I do use push, pull, and checkout. I guess everyone has a different 99%.


until you accidentally use rebase to squash commits and accidentally squash the wrong commits...


then just run `git reflog` to go back to the commit before you rebased


reflog 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: