Copying some branches of a repository into a new repository
We have a huge git repository (say it A )that contains many branches. I want to create a new smaller repository (say it B) that will contain few branches of A.
What I know is as follows
- Version control for Google App Engine
- Suggestions please for a home version control system
- How do I find if a branch has been merged to any branch (not just a specific one)
- Set up git to pull and push all branches
- How to install Tortoise SVN in to Android Studio 2.1 Latest Version
- How to set a Mercurial VCS build trigger for TeamCity that ignores label operations
- Clone some branches from repository A to local
- Push these branches to repository B.
Don’t we have some method to copy these branches directly from repository A to B?. Or some improvement to the above mthod?
One Solution collect form web for “Copying some branches of a repository into a new repository”
If you have direct access to repo
A, you can directly the branch you want to a new repo
But if you need to clone A first, then a concrete example exists in “Clone just the stable and one other branch in git?”, and uses the same tip than the question mentioned by mnagel, with
cd B git init . git remote add -f -t remote-branch1 -t remote-branch1 remote-name remote-url
-f which, when used with
git remote add, will immediately fetch