0

here we have lots of forks. We have a product that is a base, and the client can custumize it a lot. Every fork is a product, but their structure are very different, and sometimes we need to replicate some changes to our base product.

Right now I need to send a few isolated commits to our base fork, we call it Demo. After that i need to make some adjustments.

Can you guys help me out with that, is there a way of sending a few commits to other fork Locally.

I have the 2 solutions Downloaded in my computer: c:/git/[forkname]

Demo. ClientFork.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278

2 Answers2

1

The correct way to handle this is via pull requests. The basic process should be something similar to this:

  1. Create a branch in your forked repo that contains only the changes you want to contribute back to the origin. You may have to do some cherry-picking or rebasing to accomplish this.
  2. Push the branch to VSTS
  3. Open a pull request from your new branch to the appropriate branch in the origin repo
  4. Approve the PR (or wait for it to be approved by others, depending on how your branch policies are configured).
Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
0

Well I just find a way of doing that!

Reading that gave me some ideas to pick some commits. And that post here help me solving some issues that appeared in the process.

if you have a single commit you can do this:[Well if you have more then one commit I recommend cherry-picking then and squashing then]

git format-patch [your commit hash here]-1 

After that a patch will be create in the project folder with 1 single commit inside. After that open the other project in command line and use the following code:

git am [patch path here]
git am --reject
git am --continue
git am --skip

well after that the changes will be present in the project, and some changes that git couldn't handle will be in [file].rej and you will have to finished this changes by hand. But most of then will be fine.

after finishing everythin just commit and push.

  • You could [Accept it as an Answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work), This can be beneficial to other community members reading this thread. – Andy Li-MSFT Sep 06 '18 at 02:22