search

Home  >  Q&A  >  body text

github - How does git automatically ignore some files?

I have a project locally that is synchronized with github in both directions, but when I debug it locally, there is a log file all.logThis file will also change, and then when I submit it to git, it will be pulled from the cloud When I came down, it said there was a conflict...? Because the log files in the cloud will also change.

Then it prompts that synchronization failed, saying that conflicts need to be handled manually. Is there any way to directly ignore all files with log ending format when submitting?

为情所困为情所困2792 days ago605

reply all(2)I'll reply

  • 阿神

    阿神2017-05-02 09:41:25

    Add *.log to the .gitignore file

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-02 09:41:25

    First add all.log to .gitignore
    Then remove all.log in git

    git rm --cached all.log

    Submit the changes to github, all.log will not be submitted next time

    reply
    0
  • Cancelreply