If you enjoy this article on Git, also check these other Git tips:
- Stash only what
git commit
wouldn't commit - Ignore refactoring commits in
git blame
- Use your SSH key to sign commits
When coding, I often find myself wanting to quickly check the details of a function or method related to what I’m working on. For instance, I might need to understand how the function handles its arguments or recall its side effects.
If you just want to know how to do this, you can jump down and skip my story.
I usually use ctags
with Vim for this. A quick ]
, a brief read, and a <Ctrl-o>
and I’m back from whence I came and more informed for my effort. Still, sometimes would be more convenient to just have the code printed right to my terminal from the command line.
If you’re here, you might remember that we previously looked at Git’s ability to walk the history of a specific method using git log -L
1. What you might not know is that git log
and git show
are close siblings—actually defined in the same file.
Top comments (0)