Search code examples
macosgitgit-tower

Tower (Git client) not cloning all directories to the local machine from the remote repository


I have an issue with a new remote repository that when cloned using Tower, doesn't clone all the directories.

When I created the remote repository, I did the following:

  1. Created a .gitignore file containing the following line

    files/cache/*

  2. Then ran:

    git init git add . git commit

  3. I then cloned the remote repository to my local machine using a Mac OSX git client called Tower but noticed that many of the directories did not clone.

When I go back and look at my terminal session on the webserver, I can see the directories that weren't cloned listed after the initial commit - I see a whole bunch of lines that look like this:

create mode 10644 directory-name/path/to/file.php
create mode 10644 directory-name/path/file.php
create mode 10644 directory-name/path/to/file.php
create mode 10644 directory-name/path/file.php

So I'm guessing they were added but I'm also wondering if my .gitignore file is not setup right and is conflicting with Tower somehow?

I tried the .gitignore file a couple of ways, firstly like this:

files/cache/*

then like this:

files/cache/

After changing it to the second one, I ran git add -A (which didn't seem to add anything new) on the server and pulled the repo down using Tower again - but no luck.

Not sure if this is Git or Tower or both - not sure what I'm doing wrong, sorry.

Any help would be much appreciated.

Cheers

Ben


Solution

  • Don't forget that git won't add (and clone) empty directories.
    (or directories with ignored content, making them empty for Git)

    See: