When I do the following in my working copy:
> git diff 'master@{1 hour ago}'
It prints
warning: Log for 'master' only goes back to Thu, 14 Jan 2016 15:37:11 -0500.
Yet when I do git log master
, it clearly goes back farther:
commit bb9c80fb1c3895a9c11f7a60710497cc8406e71f
Author: Andy Edwards <[email protected]>
Date: Tue Jan 12 22:44:21 2016 -0600
...
Am I doing something wrong, or is this a git bug?
git pull 's job is to fetch new commits and merge them into the current branch. If the current branch is not outdated compared to the one you pull from, pull will say Already up-to-date. even if you have local changes in your working directory.
By default, the reflog expiration date is set to 90 days. An expire time can be specified by passing a command line argument --expire=time to git reflog expire or by setting a git configuration name of gc. reflogExpire .
The biggest difference between Git reflog vs. log is that the log is a public accounting of the repository's commit history while the reflog is a private, workspace-specific accounting of the repo's local commits. The Git log is part of the Git repository and is replicated after a push, fetch or pull.
Many times it's useful to know which branch or tag each commit is associated with. The --decorate flag makes git log display all of the references (e.g., branches, tags, etc) that point to each commit.
Use git-whatchanged instead.
git whatchanged --since="1 hour ago" --patch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With