I’ve been using Git for a number of years. When I was a Git beginner, I followed some prescribed steps and things worked – most of the time. This seems to be a pretty common experience for people starting out with Git. The magical part is when I started to understand Git, when I went from beginner to intermediate. These are some blog posts and videos that would have helped me with that transition.
Get Beginner
Visualizing Git Branching with Blocks
This has been the key for me understanding Git.
Blog Post
Action Item
Setup git lg
alias for better Git log viewing by running the following on the command line
git config --global alias.lg "log --oneline --graph"
For the longer version of this alias (along with an explanation), see Improve Git Log
Review
- clone https://github.com/salcode/git-branching-w-blocks
- Use
git lg
to viewmain
,feat/c
, andfeat/d
branches - Note that branch
feat/d
can be fast-forward merged intomain
(becausemain
is an ancestor offeat/d
) - Note that branch
feat/c
can be fast-forward merged intomain
(becausemain
is an ancestor offeat/c
) - Feel free to merge branches and view the results, you can always delete the directory and clone a fresh copy
Git Fast-Forward Merge Walkthrough
Visualizing Git Rebase with Blocks
Blog Posts
Git Rebase with Merge Conflict Walkthrough
Review
- Clone a fresh copy of https://github.com/salcode/git-branching-w-blocks
- Merge
feat/c
intomain
- Rebase
feat/d
with the updated version ofmain
- Fast-forward merge
feat/d
intomain
How Git Works
What is a commit?
What is a branch?
Visualizing a Merge Commit with Blocks
Blog Post
Gifs of Git Operations
GitGifs.com early release
Action Item
You’re going to find yourself editing a commit message, so make your life easier by setting the Git commit message editor to something other than Vim.
How to Write Better Commits
- Setup your editor of choice for Git commit messages (see How to Set Your Git Commit Message Editor).
- Rules for Writing Git Commit Messages
- Use git add -p to stage just some of your changes
Leave a Reply