git does not exclude .git directory
Clash 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.
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
git
add a comment |Â
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.
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
git
add a comment |Â
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.
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
git
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.
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
git
edited Feb 17 at 15:09
asked Feb 17 at 14:27
Patrick Bateman
465
465
add a comment |Â
add a comment |Â
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.
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
add a comment |Â
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.
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
add a comment |Â
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.
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
add a comment |Â
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.
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.
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
add a comment |Â
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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password