user7350714
user7350714

Reputation: 365

How to get the commits for master branch after dev branch is cut from it

I had master branch which had all my code commits.Few days back I've cut a new branch from master called dev.I made some commits in both the branches..Now I want to get all commits in master branch after dev is cut from it.. Is there any command for this .Can someone help me quickly

Thanks!

Upvotes: 0

Views: 141

Answers (2)

SzG
SzG

Reputation: 12619

It's surprisingly simple:

git log dev..master

Just to elaborate and put an end to the confusion having resulted in 16 comments:

There is a huge difference between using two dots .. or three dots ... between the branch ids:

  • With two .. you get all new commits only on master since they have diverged.
  • With three ... you get all commits on both dev and master since they have diverged.

Upvotes: -1

CJ Johnson
CJ Johnson

Reputation: 1101

By "get all commits" do you want to simply view the commits, or incorporate them into your dev branch?

If you want to add them into your branch, you'll probably want to git pull or git fetch depending on your endgame. This thread covers the difference pretty well: What is the difference between 'git pull' and 'git fetch'?

Upvotes: 0

Related Questions