pyratelog

personal blog
git clone git://git.pyratebeard.net/pyratelog.git
Log | Files | Refs | README

commit 250f6c07bf3a76e9762c2b8f2979652c002f254d
parent d2f474e7b973f5d016b5d985c604ce9ce7d8f838
Author: pyratebeard <root@pyratebeard.net>
Date:   Mon, 10 Jun 2024 21:51:55 +0100

up_git_stream

Diffstat:
Mentry/up_git_stream.md | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/entry/up_git_stream.md b/entry/up_git_stream.md @@ -4,7 +4,7 @@ Instead, over the years I have grown use to running `git fetch` and `git merge` The reason for this is so that I can review the log and any changes before merging the remote code into my local repo. -I always use to run `git log` to show the entire log after fetching the remote code, until I read about the dotted range notation and `@` construct for specifying [revisions][1] in Git. +I would try to remember to run `git log` after fetching the remote code, so I can review the log. Until I read about the dotted range notation and `@` construct for specifying [revisions][1] in Git. Using `@` on is own is equal to `HEAD`. Combine it in `git log` with `{upstream}` or `{u}` to only show commit logs for the upstream branch @@ -12,17 +12,17 @@ Using `@` on is own is equal to `HEAD`. Combine it in `git log` with `{upstream git log @{u} ``` -The two-dot notation is shorthand for all commits in a range. Therefore to show only the commits between my local branch and the remote upstream I would incant +The two-dot notation is shorthand for all commits in a range. Therefore to show only the commits from the remote upstream that have yet to be merged in my local branch I would incant ``` git log HEAD..@{u} ``` -This can be made even easier by omitting `HEAD` as leaving one end of the range blank defaults to `HEAD` +This can be made even easier by omitting `HEAD`, as leaving one end of the range blank defaults to `HEAD` ``` git log ..@{u} ``` -With this newfound knowledge I updated my [`gf` alias][2] to run both commands, automatically showing me the commits I have fetched +With this newfound knowledge I updated my [`gf` alias][2] to run both commands, automatically showing me the commits I have fetched and need to review ``` alias gf="git fetch && git log ..@{u}" ```