Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I always add libraries hosted with git as submmodules. Then if it's on github I go ahead star &amp; watch it. I have the RSS feed on my phone and on my desktop so I see when someone pushes a commits to any of those libraries. After that its as simple as going into submodules and <code>git fetch</code>&amp;<code>git merge</code>. If I want to update them all I just <code>git submodule foreach git pull</code></p> <hr> <h2>Submodules</h2> <p>Direct quote from <a href="http://jk.gs/git-submodule.html" rel="nofollow">documentation</a>:</p> <blockquote> <p>Submodules allow foreign repositories to be embedded within a dedicated subdirectory of the source tree, always pointed at a particular commit.</p> </blockquote> <p>Submodules are definately the way to go in using git hosted libraries in your projects.</p> <p>To add a submodule: <code>git submodule add &lt;repository&gt; [&lt;path&gt;]</code> path is optional and if not defined name of the repository will be used.</p> <p>When you add a submodule if you check <code>git status</code> you will see something like this.</p> <pre><code>$ git status # On branch master # Changes to be committed: # (use "git reset HEAD &lt;file&gt;..." to unstage) # # new file: .gitmodules # new file: submodule </code></pre> <p>As you noticed the whole folder is tracked as a file and there is a file called <code>.gitmodules</code> added. <code>.gitmodules</code> file is a configuration file that stores the mapping between the remote repository and the local subdirectory you pulled it in. The submodule itself you see in git. If you run a <code>git diff --cached</code> on the submodule file itself you will see its just the commit SHA of the latest commit on the submodule repository.</p> <p>Submodules in git are actual repositories so you can go in them and do anything you can do with a normal repository. Git doesn't actually track the contents of submodules it records it as a particular commit from the submodule itself. So you can use a specific commit on a submodule if you want.</p> <p>A great resource explaining submodules is the <a href="http://git-scm.com/book/en/Git-Tools-Submodules" rel="nofollow">git book</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload