How to set up git repository to use external sub-module repository

Adding

Go to sub-folder of your git-folder where you want to put new sub-module and execute

$ git submodule add git_repository_url directory_name

Make sure that directory name does not contain dashes.

Updating

Updating sub-modules from command line

$ git submodule foreach git pull

or by TortoiseGit

Updating sub-modules by TortoiseGit
Updating sub-modules by TortoiseGit.
Advertisements

How to add file to GIT and ignore subsequent changes

It can be useful if you don’t want to store some sensitive information like logins in repository.

Step 1

Add clean version of the file to GIT as usual. Commit it.

Step 2

Change file.

Step 3

Start commit by TortoiseGit, right click the file and select “Skip worktree”.

Skipping local changes of file under GIT
Skipping local changes of file under GIT.