git does not exclude .git directory

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm trying to use version control in my music folder to track how I sort it and when I add/delete music. I only need the metadata and not the contents in the repo.



To achieve this, I'm using tree to maintain two text files that are in .list in the root directory for the repo.



This is the script run by cron every 15 minutes:



cd /home/user/folder/ && tree -faRn -o /home/user/folder/.list/1
cd /home/user/folder/ && tree -faRhupsDn --du -o /home/user/folder/.list/2
git -C /home/user/folder add .list
git -C /home/user/folder commit -m $a


It's also monitoring the .git folder (!) and this means that it's committing everytime the script runs. Should I add .git to a gitignore? Why is it watching the .git folder anyway? is it because my directory is named .list? Do I need to double quote it? .list isn't a git repo.



tig output




Thanks, kusalananda!



Here's the modified (and working!) script:



cd /home/user/folder/ && tree -faRn -I '.git|.list' -o /home/user/folder/.list/1
cd /home/user/folder/ && tree -faRhupsDn -I '.git|.list' --du -o /home/user/folder/.list/2
git -C /home/user/folder add .list
git -C /home/user/folder commit -m $a






share|improve this question


























    up vote
    0
    down vote

    favorite












    I'm trying to use version control in my music folder to track how I sort it and when I add/delete music. I only need the metadata and not the contents in the repo.



    To achieve this, I'm using tree to maintain two text files that are in .list in the root directory for the repo.



    This is the script run by cron every 15 minutes:



    cd /home/user/folder/ && tree -faRn -o /home/user/folder/.list/1
    cd /home/user/folder/ && tree -faRhupsDn --du -o /home/user/folder/.list/2
    git -C /home/user/folder add .list
    git -C /home/user/folder commit -m $a


    It's also monitoring the .git folder (!) and this means that it's committing everytime the script runs. Should I add .git to a gitignore? Why is it watching the .git folder anyway? is it because my directory is named .list? Do I need to double quote it? .list isn't a git repo.



    tig output




    Thanks, kusalananda!



    Here's the modified (and working!) script:



    cd /home/user/folder/ && tree -faRn -I '.git|.list' -o /home/user/folder/.list/1
    cd /home/user/folder/ && tree -faRhupsDn -I '.git|.list' --du -o /home/user/folder/.list/2
    git -C /home/user/folder add .list
    git -C /home/user/folder commit -m $a






    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm trying to use version control in my music folder to track how I sort it and when I add/delete music. I only need the metadata and not the contents in the repo.



      To achieve this, I'm using tree to maintain two text files that are in .list in the root directory for the repo.



      This is the script run by cron every 15 minutes:



      cd /home/user/folder/ && tree -faRn -o /home/user/folder/.list/1
      cd /home/user/folder/ && tree -faRhupsDn --du -o /home/user/folder/.list/2
      git -C /home/user/folder add .list
      git -C /home/user/folder commit -m $a


      It's also monitoring the .git folder (!) and this means that it's committing everytime the script runs. Should I add .git to a gitignore? Why is it watching the .git folder anyway? is it because my directory is named .list? Do I need to double quote it? .list isn't a git repo.



      tig output




      Thanks, kusalananda!



      Here's the modified (and working!) script:



      cd /home/user/folder/ && tree -faRn -I '.git|.list' -o /home/user/folder/.list/1
      cd /home/user/folder/ && tree -faRhupsDn -I '.git|.list' --du -o /home/user/folder/.list/2
      git -C /home/user/folder add .list
      git -C /home/user/folder commit -m $a






      share|improve this question














      I'm trying to use version control in my music folder to track how I sort it and when I add/delete music. I only need the metadata and not the contents in the repo.



      To achieve this, I'm using tree to maintain two text files that are in .list in the root directory for the repo.



      This is the script run by cron every 15 minutes:



      cd /home/user/folder/ && tree -faRn -o /home/user/folder/.list/1
      cd /home/user/folder/ && tree -faRhupsDn --du -o /home/user/folder/.list/2
      git -C /home/user/folder add .list
      git -C /home/user/folder commit -m $a


      It's also monitoring the .git folder (!) and this means that it's committing everytime the script runs. Should I add .git to a gitignore? Why is it watching the .git folder anyway? is it because my directory is named .list? Do I need to double quote it? .list isn't a git repo.



      tig output




      Thanks, kusalananda!



      Here's the modified (and working!) script:



      cd /home/user/folder/ && tree -faRn -I '.git|.list' -o /home/user/folder/.list/1
      cd /home/user/folder/ && tree -faRhupsDn -I '.git|.list' --du -o /home/user/folder/.list/2
      git -C /home/user/folder add .list
      git -C /home/user/folder commit -m $a








      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 17 at 15:09

























      asked Feb 17 at 14:27









      Patrick Bateman

      465




      465




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          It is tree that looks into the .git directory.



          You will want to tell tree to ignore the .git directory. On the Ubuntu machine that I have access to, this is done with



          tree -I '.git' ...other options...


          You may also want to have it ignore the .list folder.






          share|improve this answer






















          • How did I miss that?
            – Patrick Bateman
            Feb 17 at 15:02










          • @PatrickBateman Head-too-full-induced selective blindness. Happens to me on the best of days. Hmm... "Inattentional blindness" is a thing it seems.
            – Kusalananda
            Feb 17 at 15:03











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424806%2fgit-does-not-exclude-git-directory%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote



          accepted










          It is tree that looks into the .git directory.



          You will want to tell tree to ignore the .git directory. On the Ubuntu machine that I have access to, this is done with



          tree -I '.git' ...other options...


          You may also want to have it ignore the .list folder.






          share|improve this answer






















          • How did I miss that?
            – Patrick Bateman
            Feb 17 at 15:02










          • @PatrickBateman Head-too-full-induced selective blindness. Happens to me on the best of days. Hmm... "Inattentional blindness" is a thing it seems.
            – Kusalananda
            Feb 17 at 15:03















          up vote
          3
          down vote



          accepted










          It is tree that looks into the .git directory.



          You will want to tell tree to ignore the .git directory. On the Ubuntu machine that I have access to, this is done with



          tree -I '.git' ...other options...


          You may also want to have it ignore the .list folder.






          share|improve this answer






















          • How did I miss that?
            – Patrick Bateman
            Feb 17 at 15:02










          • @PatrickBateman Head-too-full-induced selective blindness. Happens to me on the best of days. Hmm... "Inattentional blindness" is a thing it seems.
            – Kusalananda
            Feb 17 at 15:03













          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          It is tree that looks into the .git directory.



          You will want to tell tree to ignore the .git directory. On the Ubuntu machine that I have access to, this is done with



          tree -I '.git' ...other options...


          You may also want to have it ignore the .list folder.






          share|improve this answer














          It is tree that looks into the .git directory.



          You will want to tell tree to ignore the .git directory. On the Ubuntu machine that I have access to, this is done with



          tree -I '.git' ...other options...


          You may also want to have it ignore the .list folder.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 17 at 14:58

























          answered Feb 17 at 14:52









          Kusalananda

          103k13202318




          103k13202318











          • How did I miss that?
            – Patrick Bateman
            Feb 17 at 15:02










          • @PatrickBateman Head-too-full-induced selective blindness. Happens to me on the best of days. Hmm... "Inattentional blindness" is a thing it seems.
            – Kusalananda
            Feb 17 at 15:03

















          • How did I miss that?
            – Patrick Bateman
            Feb 17 at 15:02










          • @PatrickBateman Head-too-full-induced selective blindness. Happens to me on the best of days. Hmm... "Inattentional blindness" is a thing it seems.
            – Kusalananda
            Feb 17 at 15:03
















          How did I miss that?
          – Patrick Bateman
          Feb 17 at 15:02




          How did I miss that?
          – Patrick Bateman
          Feb 17 at 15:02












          @PatrickBateman Head-too-full-induced selective blindness. Happens to me on the best of days. Hmm... "Inattentional blindness" is a thing it seems.
          – Kusalananda
          Feb 17 at 15:03





          @PatrickBateman Head-too-full-induced selective blindness. Happens to me on the best of days. Hmm... "Inattentional blindness" is a thing it seems.
          – Kusalananda
          Feb 17 at 15:03













           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424806%2fgit-does-not-exclude-git-directory%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay