How do you link a single file from another git repository to your own repository? I don't want the full repository, just a single file. Using git submodule
seems like the right route to go, but it wants to grab the whole thing.
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
Considering that the unit of work for git is a repository (or more precisely a repository content), I don't think you can easily integrate one file.
If you don't need its history, you could consider simply copy it in your repo.
But if you do need the history, then some
git filter-branch
(as in "git: How to split off library from project? filter-branch, subtree?") are in order. That seems a lot of effort for just one file though.In theory, "git: symlink/reference to a file in an external repository" suggests a solution combining submodule and symlink.
(from Pavel Šimerda)