1

I'm new to git. I've done some simple operations:
create a repo add an file 'A' into the local repo, then stage, commit and push to the master branch (commit1)
create a branch by running git checkout -b branch_name
create a new file 'B' and edit 'A', stage, commit, then git push origin branch_name (commit2)
then to merge it to master branch, I simply run git checkout master, git merge branch_name,git push origin master.
Remote master branch has updated. Then I run git log in master branch, only 2 commits are shown:


commit1 ae6ebbb... (HEAD -> master, origin/branch_name, origin/master, branch_name)
commit2 ccc6af3...

How Can I find the merge history? (tried git log --merges doesn't work) Am I making any mistake in this process? The reason I want to get the merge hash is to revert back to the status before merge. Could plz any one tell me how to do it?

torek
  • 448,244
  • 59
  • 642
  • 775
SKSKSKSK
  • 545
  • 1
  • 4
  • 15
  • 3
    Fast-forward merge. See the answer in this neighbour question: https://stackoverflow.com/a/66309133/7976758 – phd Feb 22 '21 at 07:34
  • Git default merge strategy is **Fast-forward if possible**. If you wanna see the merge commit, you should add the `--no-ff` parameter – Prihex Feb 24 '21 at 07:08

0 Answers0