Comment by aetherspawn

7 years ago

For me the big thing was learning to 1/ not work on master unless I’m alone and 2/ commit all my work incrementally

    git pull —-rebase

&

    git log 
    git rebase -i HEAD~n

So basically I want to make sure my work is pushed to remote as a separate commit before attempting to run any commands except the ones above. But you can do pretty much anything with the set above.

I generally replace `git pull` with a `git fetch $remote` + `git rebase $remote/branch-name`. It provides the added benefit that I can easily diff changes prior to the rebase so that I know what is going into my branch. The use of the `--rebase` flag isn't bad though and I may start doing that when I know I will not be doing any diff prior to a rebase.

I also use `git merge-base` quite a bit so that I do not have to count commits when working with really simple branches.