Created
April 7, 2012 03:46
-
-
Save kana/2324900 to your computer and use it in GitHub Desktop.
git submodule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git --version | |
git version 1.7.9.1.244.gb0d66b | |
$ mkdir git-submodule | |
$ cd ./git-submodule | |
$ git init | |
Initialized empty Git repository in /Users/kana/tmp/git-submodule/.git/ | |
$ touch a | |
$ git add a | |
$ git commit -am 'Initial commit' | |
[master (root-commit) eff0f57] Initial commit | |
0 files changed | |
create mode 100644 a | |
$ git submodule add $PWD foo | |
Cloning into 'foo'... | |
done. | |
$ git commit -am 'Add submodule' | |
[master 02756fb] Add submodule | |
2 files changed, 4 insertions(+) | |
create mode 100644 .gitmodules | |
create mode 160000 foo | |
$ date >foo/untracked-file | |
$ git status | |
# On branch master | |
# Changes not staged for commit: | |
# (use "git add <file>..." to update what will be committed) | |
# (use "git checkout -- <file>..." to discard changes in working directory) | |
# (commit or discard the untracked or modified content in submodules) | |
# | |
# modified: foo (untracked content) | |
# | |
no changes added to commit (use "git add" and/or "git commit -a") | |
$ git submodule status | |
eff0f571027b64f67bd4d66fdc924ae956bba51d foo (heads/master) | |
$ cd ./foo | |
$ git status | |
# On branch master | |
# Untracked files: | |
# (use "git add <file>..." to include in what will be committed) | |
# | |
# untracked-file | |
nothing added to commit but untracked files present (use "git add" to track) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment