简体   繁体   中英

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!

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'?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM