Difference between double-dot “..” and caret / hat symbol “^” in git

When I want to find the commits that are in branch A but not in branch B I often write

git log A ^ B

But according to the SO post
How do I see the commit differences between branches in git? the following does the same thing:

  • How to change orientation in tig status view
  • Need to grab a bit of code from a previous commit — Sourcetree
  • How to understand the graph output of `git log --all --graph --oneline --decorate`?
  • Can I make a “deep copy” of a git repository with submodules?
  • Reconflict the merge, after incorrect manual merge conflict resolution
  • How to have Git store CRLF in index
  • git log B..A

    Are these commands identical? What is the difference?

  • Best way to use ROS/catkin with github
  • Exclude Preceding Commit> line from git rev-list formatting
  • git log shows an unmerged changeset
  • What parts of a Django project should I not include in Git?
  • Why git shows a merge conflict when the HEAD version has no content at the line
  • Tracking branches in bare git repository?
  • One Solution collect form web for “Difference between double-dot “..” and caret / hat symbol “^” in git”

    From the official documentation for git log covering History Simplification we find:

    When given a range of commits to display (e.g. commit1..commit2 or commit2 ^commit1), only display commits that exist directly on the ancestry chain between the commit1 and commit2, i.e. commits that are both descendants of commit1, and ancestors of commit2.

    It seems from the documentation itself that either git log ^ B and git log A..B behave identically, and the ^ and .. operators can be used interchangeably with git log.

    Git Baby is a git and github fan, let's start git clone.