Git and multiple repositories
I'm using github to store my PowerShell profile. I found posh-vcs that I'd like to use on top of my actual implementation. I'd like to be able to merge changes from posh-vcs to my current environment.
What would be t开发者_如何学JAVAhe best way to handle this? Just have one repository for my files, and in another folder have the posh-vcs? Or is this an appropriate use of the Fork? i.e., fork the project and add my own files, merging from the parent project when appropriate?
If you have a similar structure between the two repositories, you can try a grafts
technique to:
- fork his project
- import your history into this forked repo
The fork is only interesting if you want to contribute back to that external repo.
If not, you can simply clone the external repo and import your history through the grafts file, changing your repo (without any link with the post-vcs repo)
Other options involves:
- considering the external repo as a subtree of your repo (subtree merge strategy)
- considering the external repo as a submodule of your repo( quite handy if you need to push/pull from the post-vcs repo, while managing your own repo)
See those two options in the question on repo tranfers, with this answer for more on submodules.
精彩评论