How to clone a Github Gist via SSH protocol?
[+]
git clone git@github.com:5834862.git
change
https://
to
git@
and
/****.git
to
:****.git
Be sure to include empty dirs
[+]
Before
Be sure to create empty files into empty dirs by
find . -type d -empty -not -path "./.git/*" -exec touch {}/.gitkeep \;
Submodules
[+]
Submodules are an efficient way to combine several independet
GitHub repos.
Suppose that in your new repo, called `NewRepo` , for which you already have a cloned local copy. Suppose that you want to use an external repo called `rock`. Then in your cloned local copy you can use
git submodule add https://github.com/<user>/rock rock
git commit -am 'New submodel rock added'
git push origin master
If you look at your repo in
GitHub you now should have an special folder with the assigned submodule name, which is just a link to the official existing repo. Note however that the submodule have a hash for the specific cloned branch.
The next time we clone the new repo you must use the proper option to clone also the submodules:
git clone --recursive https://github.com/MyUser/NewRepo
Or if you just forgot to use the `--recursive option`, just use in your cloned local copy
git submodule update --init --recursive
Now, suppose that the external repo is updated and you need your new repo to point out to the last version. This can be accomplished with
git pull --recurse-submodules
git submodule update --remote --recursive
git commit -am 'Updated Submodules tags'
git push origin master
Further info in
https://github.com/blog/2104-working-with-submodules