Let's say I have a Git repo with branch A
and branch B
.
Branch B
is currently checked out (i.e. .git/HEAD
contains refs/heads/B
).
Now, without checking out branch A
, how to view the history (log) of path/file
in branch A
?
Following git help rev-parse
, I've attempted to use git log A:path/file
, but that doesn't seem to work (outputs nothing). Why?
After running the stash command for a branch, if the git user wants to pull the branch's changes to another branch, it can be done easily by using the `git stash pop` command that works like the `git merge` command.
tree-ish (also treeish) A tree object or an object that can be recursively dereferenced to a tree object.
Graph all git branchesDevelopers can see all branches in the graph with the –all switch. Also, in most situations, the –decorate switch will provide all the supplemental information in a formatted and nicely color-coded way.
On GitHub.com, you can access your project history by selecting the commit button from the code tab on your project. Locally, you can use git log . The git log command enables you to display a list of all of the commits on your current branch. By default, the git log command presents a lot of information all at once.
Try this (without the angle brackets):
git log <branch> -- <path/to/file>
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