0

I have two projects with similar code base. I work on new features on both repositories and I make some changes on both, that should not be shared to the other. I want to use branches in git, to make sure I can always merge the new features from one to another.

In projectA I create a feature branch from projectA/master, make few commits and merge them to projectA/master. In projectB I tried to merge projectA/feature-branch to projectB/master, but the projectA specific clutter would be merged as well.

It is possible to view all commits of the specific branch with

git show projectA/master..projectA/feature-branch 

And I’d like to have something similar for merging

git merge --no-ff projectA/master..projectA/feature-branch 

so that only the commits, directly committed to the feature-branch will be merged. Is this possible somehow?

1 Answer 1

1

Maybe you are looking for cherry pick.

Git reference:

https://git-scm.com/docs/git-cherry-pick

And you can see this article:

https://ariejan.net/2010/06/10/cherry-picking-specific-commits-from-another-branch/

I'd like to use a graphical tool like Git extensions for this, but it just up to you. I hope you find it useful (:

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your advise! After some testing I can confirm, that cherry-pick has a feature that helps me. It is possible to do something like I need with git cherry-pick projectA/feature-branch projectA/master..projectA/feature-branch, which is shown in an example of the docs. Thanks again for pointing my to this :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.