Can I checkout to most current commit on git?

I have a git alias lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all

when I run $ git lg and I can see below.

*   0c86f9e - (3weeks ago) WIP on master: 3c98495 Delete old depart info and blog section - me(refs/stash)
|\
| * 1790d55 - (3weeks ago) index on master: 3c98495 Delete old depart info and blog section - me
|/
* 3c98495 - (5weeks ago) Delete old depart info and blog section - me (HEAD -> master)
* ffa196a - (5weeks ago) Delete client list section - me
* 4934070 - (5weeks ago) Delete portfolio section - me
* f73d676 - (5weeks ago) Show custom categories about departments - me
| * a9a174a - (5weeks ago) tmp save - me (feature/tmp)
|/
* 1f420bc - (7weeks ago) blabla... - me (origin/master, origin/HEAD)
.
.
.

But I had a more commit logs after 0c86f9e. maybe like below

*   0111113 - (3days ago) blahblah - me (HEAD)
*   0111111 - (3days ago) blahblah - me
*   0222222 - (3days ago) blahblah - me
*   0c86f9e - (3weeks ago) WIP on master: 3c98495 Delete old depart info and blog section - me(refs/stash)
|\
| * 1790d55 - (3weeks ago) index on master: 3c98495 Delete old depart info and blog section - me
|/

I want to go most current commit. But I can't find log. How can I see log and jump?

2 answers

  • answered 2018-11-08 08:21 Vince

    Assuming the more recent commits you refer to are on the server, you need to pull. Run git pull, or git fetch if you do not want to update your current local version. The commits should then be visible.

  • answered 2018-11-08 12:39 jthill

    The long-form way to get it is

    git rev-list --all --reflog --date-order -1
    

    and git log (naturally) also takes the --reflog option.