Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore unwanted files and directories #163

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Ignore unwanted files and directories #163

wants to merge 4 commits into from

Conversation

abhisekp
Copy link
Collaborator

  • Ignores unwanted os, editor and program specific files and directories.
  • Ignore auto-generated wiki directory.

closes #149 and closes #159

Ignore OS, Editor and Program specific files and directories.

close #149

Ignore OSes
- windows
- linux
- osx

Ignore Editors
- webstorm
- komodoedit
- eclipse
- emacs
- slickedit
- notepadpp
- netbeans
- kate
- cloud9
- anjuta
- dreamweaver
- textmate
- espresso
- visualstudio
- visualstudiocode
- vim
- sublimetext

Ignore Programs
- vagrant
- tortoisegit
- node

GitIgnore.io API URL:
https://www.gitignore.io/api/windows,linux,osx,webstorm,komodoedit,eclipse,emacs,slickedit,notepadpp,netbeans,kate,cloud9,anjuta,dreamweaver,textmate,espresso,visualstudio,visualstudiocode,vim,sublimetext,vagrant,tortoisegit,node
@abhisekp
Copy link
Collaborator Author

@dcsan Don't merge now. Issue due to two .gitignore files and also necessary files being ignored.

@abhisekp
Copy link
Collaborator Author

I've added the following in the .gitignore file.

logs/
*.log
!README.md

but it ignores nap/logs/README.md which it shouldn't

List of ignored files:

nap/docs/nap.sublime-workspace
nap/logs/README.md
nap/mylogfile.log

Reference: https://git-scm.com/docs/gitignore

@dcsan
Copy link
Owner

dcsan commented Aug 20, 2015

thats probably because that file was already in git. you have to remove it,
then git ignore it after its removed...

On Thu, Aug 20, 2015 at 3:27 PM, Abhisek Pattnaik notifications@github.com
wrote:

I've added the following in the .gitignore file.

logs/
*.log
!README.md

but it doesn't ignore nap/logs/README.md

nap/docs/nap.sublime-workspace
nap/logs/README.md
nap/mylogfile.log


Reply to this email directly or view it on GitHub
#163 (comment).


David 'DC' Collier
dc@biz.pikkle.com
skype: d3ntaku

http://jp.linkedin.com/in/dcsan/

@abhisekp
Copy link
Collaborator Author

@dcsan updated the previous message.
I meant nap/logs/README.md is ignored.

How do I make it not ignore and track? Any suggestions?

@dcsan
Copy link
Owner

dcsan commented Aug 20, 2015

ugh, git makes this such a mess. I think:

(make a copy of the file somewhere)

delete the file and commit that status
you may need to set it so it is NOT ignored to delete it!!!

then ignore
then move copied file back
you should not be able to check it in again now.

/dc

On Thu, Aug 20, 2015 at 3:56 PM, Abhisek Pattnaik notifications@github.com
wrote:

@dcsan https://github.com/dcsan updated the previous message.
I meant nap/logs/README.md is ignored.

How do I make it not ignore and track? Any suggestions?


Reply to this email directly or view it on GitHub
#163 (comment).


David 'DC' Collier
dc@biz.pikkle.com
skype: d3ntaku

http://jp.linkedin.com/in/dcsan/

@abhisekp
Copy link
Collaborator Author

@dcsan (unrelated to above issue) shouldn't the README.md file be renamed to .gitkeep?
i.e. keep an empty directory by creating a file named .gitkeep in it.

@abhisekp
Copy link
Collaborator Author

@dcsan
Got a solution

!/logs/
*.log

instead of

logs/
*.log
!README.md

According to https://git-scm.com/docs/gitignore#_pattern_format

Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined.

@abhisekp
Copy link
Collaborator Author

@dcsan I guess this file nap/mylogfile.log is not needed. So it's ok to ignore it. Right?
Or do I need to exclude ignore of this files in the nap directory .gitignore file?

!/mylogfile.log

close #149 and close #159
@abhisekp
Copy link
Collaborator Author

NOTE: No repo file deletions will be pushed in this PR. File deletions will be done in another PR.
Issue #164

List of files to be ignored and ready for deletion by executing the following command

git ls-files --ignored --exclude-standard | egrep --invert-match 'data/wiki/' | less

Files to be ignored and deleted

But executing the following command for deleting those files,

git ls-files --ignored --exclude-standard | xargs git rm

it deletes only some files from the nap/data/wiki/*.md i.e. upto _Footer.md (excluding) file.

and when I execute the following command,

git ls-files --ignored --exclude-standard | xargs -0 git rm

it shows an error: xargs: argument line too long

deleted

How to delete ignored files from working tree and repo?

@dcsan
Copy link
Owner

dcsan commented Aug 21, 2015

you can just delete the dir if the arg list is too long...

On Thu, Aug 20, 2015 at 5:45 PM, Abhisek Pattnaik notifications@github.com
wrote:

List of files to be ignored and ready for deletion by executing the
following command

git ls-files --ignored --exclude-standard | egrep --invert-match 'data/wiki/' | less command

[image: Files to be ignored and deleted]
https://camo.githubusercontent.com/0f3c0c692c7cbdafe0fef8fde8fdbb964592aa6e/687474703a2f2f692e696d6775722e636f6d2f627636547068702e706e67

But executing the following command for deleting those files,

git ls-files --ignored --exclude-standard | xargs git rm

it deletes only some files from the nap/data/wiki/*.md i.e. upto
_Footer.md (excluding) file.

and of I give the following command,

git ls-files --ignored --exclude-standard | xargs -0 git rm

it shows an error: xargs: argument line too long

[image: deleted]
https://camo.githubusercontent.com/8510062388edf5ddf20aee84490549ac29b286f1/687474703a2f2f692e696d6775722e636f6d2f4157695276764e2e706e67
How to delete ignored files from working tree and repo?


Reply to this email directly or view it on GitHub
#163 (comment).


David 'DC' Collier
dc@biz.pikkle.com
skype: d3ntaku

http://jp.linkedin.com/in/dcsan/

@abhisekp
Copy link
Collaborator Author

@dcsan What if it breaks logging code due to non-existent directory file creation?
Why did you keep that README.md file and asked not to delete the directory?

Is there any way to pass the argument list in a streamline way?

@dcsan
Copy link
Owner

dcsan commented Aug 21, 2015

yeah thats the whole point, the directory has to exist or the app will
crash on a new install

check the contents of the README

On Thu, Aug 20, 2015 at 5:58 PM, Abhisek Pattnaik notifications@github.com
wrote:

@dcsan https://github.com/dcsan What if it breaks logging code due to
non-existent directory file creation?
Why did you keep that README.md file and asked not to delete the
directory?


Reply to this email directly or view it on GitHub
#163 (comment).


David 'DC' Collier
dc@biz.pikkle.com
skype: d3ntaku

http://jp.linkedin.com/in/dcsan/

@abhisekp
Copy link
Collaborator Author

@dcsan please read all the messages posted in the issues in the issues page.
Don't read it in email and reply. Many times people add other more infos by editing the message which don't end up in the mail.

In various messages before this one, I've added other infos which I believe you've not read.
So don't read and reply from mail. 😄

@dcsan
Copy link
Owner

dcsan commented Aug 21, 2015

OK i've scanned the issue and spent a lot of time on it already. i prefer to be productive and not waste hours on how the files are laid out. if you want to do git ignores please do, but it was working fine before.

what is the benefit of spending all this time on this issue? it seems like you screwed up with git and so i helped you fix it.

@abhisekp abhisekp mentioned this pull request Aug 21, 2015
@abhisekp
Copy link
Collaborator Author

@dcsan thanks for all the help. #164

What about this? #163 (comment)

@dcsan
Copy link
Owner

dcsan commented Aug 21, 2015

nap/mylogfile.log

i dont know what that file is. seems like a random logfile, so you could delete it i guess.

@abhisekp abhisekp closed this Aug 21, 2015
@abhisekp abhisekp deleted the add-gitignore branch August 21, 2015 01:58
@abhisekp abhisekp restored the add-gitignore branch August 21, 2015 02:01
@abhisekp abhisekp reopened this Aug 21, 2015
@abhisekp
Copy link
Collaborator Author

@dcsan you can freely merge this now.
This only updates the .gitignore files without breaking anything.

@dcsan dcsan mentioned this pull request Aug 21, 2015
@abhisekp
Copy link
Collaborator Author

@dcsan good to go now. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignore auto-generated file directories Use GitIgnore.io API to generate .gitignore
2 participants