Reputation: 497
I have very limited bandwidth,so I was wondering if it whether it would be possible to get a commit from another repository without actually cloning it. The two repositories have the same file structure but they do not share history at all. Both of them are independent of each other but I still want to cherry-pick a commit from one of them to other. Is this possible ?
Upvotes: 4
Views: 2805
Reputation: 30888
You could just fetch the branch that has the commit from another git repo and then git cherry-pick it.
Upvotes: 0
Reputation: 1326746
Short answer: in theory possible, but not easy to do.
From "Retrieve specific commit from a remote Git repository", you would need:
git config uploadpack.allowReachableSHA1InWant true
(on the server side)That is: you would initialize an empty repo, add the url of the remote origin repo, and:
git fetch --depth=1 ../testrepo/.git <SHA1>
That would bring only one commit.
Upvotes: 4