5 ms·
99% of the time I use: - git status - git add ... - git reset ... - git commit ... - git log ... - git push/pull ... I guess that's "the basics" - what c
by plongeur 12y ago
99% of the time I use:
- git status
- git add ...
- git reset ...
- git commit ...
- git log ...
- git push/pull ...
I guess that's "the basics" - what command should I learn next?
- naggie 12y ago> git rebase -i Very useful!
- qzw 12y agoYes, but watch out if you've already pushed to remote branches or even done merge/rebase with other local branches. You're rewriting history.
- Zikes 12y agoI most often use it because I forgot to include a certain file in my most recent commit. I'll just commit that file then rebase -i to merge the two.
- regularjack 12y agoIf you want to alter the most recent commit, you can 'git commit --amend', no need to rebase. http://git-scm.com/book/en/v2/Git-Basics-Undoing-Things http://git-scm.com/book/en/v2/Git-Basics-Undoing-Things
- lentil 12y agoFor quick changes to the most recent commit, a handy alias to put in your ~/.gitconfig is: fixup = commit --amend -C HEAD That way you can stage whatever you forgot, and then do `git fixup` to update the latest commit with it. Saves a little bit of typing :) I do love `rebase -i` for anything more complicated though.
- fennecfoxen 12y agothat flows naturally into git reflog -- to get you out of a botched rebase with git reset :P
- mbell 12y agoCommand to learn: - git rebase (if you learn everything you can do with this command, you'll pretty much know git inside and out) Other useful stuff: - git diff - git diff --cached - git log --graph --decorate --pretty=oneline --abbrev-commit --all - git cherry-pick - git stash
- joe_inferno 12y agogit bisect is a powerful one i use to identify when a given bug was introduced
- abvdasker 12y agoI use this command constantly: http://blog.kfish.org/2010/04/git-lola.html http://blog.kfish.org/2010/04/git-lola.html Being able to see the graph structure made it far easier for me to get a grasp git's general structure and flow on a higher level.
- Aga 12y agoLooking at the history tree with all the branches and remote branches is a great way really understand Git. More powerful history browsers to "lola": * gitk (graphical, developed in git's own repo) https://lostechies.com/joshuaflanagan/2010/09/03/use-gitk-to-understand-git/ https://lostechies.com/joshuaflanagan/2010/09/03/use-gitk-to... * tig (console) http://jonas.nitro.dk/tig/manual.html http://jonas.nitro.dk/tig/manual.html
- icefox 12y agoInstall git achievements (https://github.com/icefox/git-achievements https://github.com/icefox/git-achievements) and get free internet points to expore them all. Disclaimer: wrote this a few years ago and it has way more users than I ever would have thought.
- rileymat 12y agobisect.