How to integrate code from forks into new branch for inspection and usage? #102756
-
|
Hello, I found myself an interesting project to witch I want to contribute. Let's call it project A. (in fact it is project Astrolog by CruiserOne). I have made a fork A' in my GitHub account and cloned it to my computer. I could start creating a development branch and hacking happily on it. So far, so good. Now I found, that A has another interesting fork here on GitHub, let's call it B. B has a branch 'foo' that especially interests me. 'foo' is directly branched from the head of B, which is the same as the head of A. At least it is the same content, although hosted under a different name. Now I want to integrate 'foo' in my clone of A for inspection and testing and learning from it and maybe than integrate it in my development branch for further usage. Here is my question. What is the proper way to do that? Do I need to fork B here on GitHub? Than I could clone it in another directory and manually pull interesting things in my primary clone. It would work, but it seems odd, because this way all the commit messages would be lost. Or can I fetch 'foo' somehow directly in my clone of A, despite the fact, that it is hosted under a different URL? So far I've done some of the git tutorials and I suppose there is a generic way to do what I want. But the sheer number of options with all that remote stuff is overwhelming. So, mybee there is a simple hint or an important concept that I've missed. More succinctly, there are two repos on GitHub. One is a fork of the other. I want their both branches to be present in one local repository on my computer (at least) or in my GitHub fork of the first one aswell (at best). Along with all the original commit messages and attributions. sincerly, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Hi Thomas, to integrate the 'foo' branch from repo B into your local clone of repo A, following steps can be helpful:
With this, you'll be able to integrate the 'foo' branch from repo B into your local clone of repo A. Sincerely, |
Beta Was this translation helpful? Give feedback.
-
|
Hello pls how can I create a pairing code to connect to Whatsapp for session id for Whatsapp Bot |
Beta Was this translation helpful? Give feedback.
Hi Thomas, to integrate the 'foo' branch from repo B into your local clone of repo A, following steps can be helpful:
Add Repository B as a Remote:
git remote add B <URL_of_Repository_B>
Fetch the 'foo' Branch from Repository B:
git fetch B foo
Merge 'foo' Branch into Your Branch:
git checkout <your_development_branch>
git merge B/foo
Push Changes to Your GitHub Fork (Optional):
git push origin <your_development_branch>
With this, you'll be able to integrate the 'foo' branch from repo B into your local clone of repo A.
Sincerely,
Chava