0

So currently I have some commits to my staging branch (merged from different branches)

68b9ba0 (latest commit)
0c24a8c (previous commit)
some commit(previous to above)

Now I dont want the latest commit merged to 'master' branch. I want to merge all the other previous commits(0c24a8c + other commits that were made before) to master.

Do i have to use something like gi-cherry pick for this?

I also need to deploy my changes to production environment through capistrano.

Do i need to create a specific tag which doesn't contain the latest commit(68b9ba0)? Can someone help me with it?

Note: I want to keep the latest commit 68b9ba0 in staging.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
newbie
  • 1,023
  • 20
  • 46
  • You can pass a SHA to `git merge` like `git merge 0c24a8c` – Andrew C Jan 16 '15 at 19:05
  • @AndrewC. Sorry let me edit my question. I want all the commits previous to 68b9ba0 to be merged in. Not just 0c24a8c – newbie Jan 16 '15 at 19:10
  • 1
    I understood that. Git works on reachability, if you merge 0c24a8c you also merge all commits reachable from 0c24a8c. – Andrew C Jan 16 '15 at 19:11
  • possible duplicate of [Merge up to a specific commit](http://stackoverflow.com/questions/8223103/merge-up-to-a-specific-commit) – Andrew C Jan 16 '15 at 19:28

1 Answers1

2

If I'm reading your question correctly, all of your commits are on the same branch. If this is the case, merging 0c24a8c should merge all of the commits prior to it with the master branch.

git merge 0c24a8c

Covered previously on StackOverflow here - Merge up to a specific commit

Community
  • 1
  • 1
Chris Short
  • 71
  • 1
  • 3