jperla/git-subdir
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
Git-subdir is an alternative to git submodules, git-subtree, etc. Git-subdir is easy to use. It places files from other repositories flat in the main repository. This allows existing diff tools to see what changes are made when sub repositories are modified. This also prevents any files from getting out of sync or in a bad state as they often do with submodules. Finally, it is transparent to users of the repo, and is very easy for sub repository maintainers to maintain. It stores meta-data in a .gitsubdirs file in the git root. Commands must be run from the git root. Git-subdir does not make commits, but it sets up the flat files ready for the commit. 1-minute tutorial: Create a new sub repository to a specific commit: $> cd ~/myproject $> git-subdir clone third-party/OCMock git@github.com:erikdoe/ocmock.git a32cf38 Or maybe just get whatever latest master HEAD is: $> git-subdir clone third-party/OCMock git@github.com:erikdoe/ocmock.git It is easy for maintainers to update to the latest version: $> cd ~/myproject $> git-subdir pull third-party/OCMock master But you can also checkout specific versions if you need to: $> git-subdir pull third-party/OCMock a32cf38e5e Delete subdirs easily: $> cd ~/myproject $> git-subdir rm third-party/OCMock Finally, local changes you make can be pushed over to another local repository you have on your system so that it's easy to synchronize changes back upstream: $> cd ~/myproject $> git-subdir push third-party/OCMock ~/OCMock # TODO: # write more tests where we have submodules within submodules (spdlay)