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

Check and validate .gitignore file #322

Open
BaseMax opened this issue Nov 18, 2024 · 5 comments
Open

Check and validate .gitignore file #322

BaseMax opened this issue Nov 18, 2024 · 5 comments
Labels
question Further information is requested testing
Milestone

Comments

@BaseMax
Copy link
Member

BaseMax commented Nov 18, 2024

No description provided.

@BaseMax
Copy link
Member Author

BaseMax commented Nov 18, 2024

Looks valid.

C:\Users\MAX\Salam>git check-ignore -v -- .gitignore

@BaseMax
Copy link
Member Author

BaseMax commented Nov 18, 2024


C:\Users\MAX\Salam>git check-ignore -v *

C:\Users\MAX\Salam>git check-ignore *

why results are empty?

@BaseMax
Copy link
Member Author

BaseMax commented Nov 18, 2024

@BDadmehr0
Copy link
Member

  1. Check .gitignore file
    Ensure the .gitignore file exists in the root directory and has valid patterns. Example to ignore .log files:

    *.log
    
  2. Verify ignored files
    Use git check-ignore to verify if files are being ignored:

    git check-ignore -v somefile.txt

    If using git check-ignore -v *, ensure some files match .gitignore patterns.

  3. Avoid shell expansion
    * expands in the shell before being passed to git. To prevent this, use:

    git check-ignore -v -- *
  4. Check .gitignore syntax
    Make sure your .gitignore patterns are correct. Refer to Git ignore documentation for details.

  5. Untrack previously tracked files
    If files were tracked before adding to .gitignore, run:

    git rm --cached <file>

This should help you understand and troubleshoot why git check-ignore might not be returning any results.

@jbampton jbampton added this to the November milestone Nov 25, 2024
@jbampton jbampton added question Further information is requested testing labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested testing
Projects
None yet
Development

No branches or pull requests

3 participants