Solved Problem: to show external code dependency by submodules: Thanks to VonC!
Current Problem: to have a submodule without duplicate contents in two folders
A temporary solution to the current problem: to change the name of the folder to bin-github, since the name of the folder as a submodule is bin. This means I need to duplicate contents at my Home.
My HOME folder is dependent on ~/bin. I have files located at HOME at the repository Masi, while at ~/bin at the repo bin at Github. My relevant folder structure at Home:
~
|-- [drwxr-xr-x] bin
| -- fileA
` -- folderA
...
I would like to know how to show make ~/bin a submodule of the Git at Masi.
How can you make ~/bin a submodule of my Git at ~/ ?
#3 Reply to VonC's comment:
My .gitmodules
[submodule "bin"]
path = bin
url = git://github.com/masi/bin.git
I feel that I do not need to add anymore the submodule again, since I have it in my .gitmodules.
I run
Sam master $ git submodule update
Sam master $ git submodule foreach git pull
Sam master $ ls bin
#2 Reply to VonC's answer:
I changed my .gitmodules to the following such that I do not have a duplicate copy of it in my home.
[submodule "bin"]
path = bin
url = git://github.com/masi/bin.git
This seems to be a different situation as I cannot pull the submodule-bin -folder similarly as above.
I get the following now at a fresh-cloned git-repo
Sam master $ git submodule git init
error: pathspec 'git' did not match any file(s) known to git.
error: pathspec 'init' did not match any file(s) known to git.
Did you forget to 'git add'? # I am not sure what this means
Sam master $ git submodule foreach git pull
Sam master $ git submodule update
I have the external repository in my .gitmodules. Why is it asking me to git add
?
Reply to VonC's answer:
I run
git submodule add git://github.com/masi/bin.git bin-github-copy
because I cannot add a new repo with the same name as my existing folder bin
.
My .gitmodules is
[submodule "bin-github-copy"]
path = bin-github-copy
url = git://github.com/masi/bin.git
I run
git clone git://github.com/masi/Sam.git
I get an emty bin -directory.
How can I get the content of bin?