1

I was wondering if there is a way to automatic pull from git without overwriting files in a certain folder, I already discovered a way to automatic pull and overwrite local data but we also have log files/player logs which must be excluded from the pull.

Is there anyway to do this through gitignore? (I am still new to git and tried to exclude the folder and including files without success so far)

Thanks in advance!

crasyboy42
  • 57
  • 2
  • 7
  • Possible duplicate of [Is it possible for git pull to ignore some files / folders?](http://stackoverflow.com/questions/36376136/is-it-possible-for-git-pull-to-ignore-some-files-folders) – tripleee Apr 02 '16 at 18:10
  • No it isn't, there must be active log files in the git repo, and not remove it completely from git same is for the user logs – crasyboy42 Apr 04 '16 at 08:28
  • I'm afraid I cannot parse your refutation, but the linked question shows how to keep the local version of a file even if the pull would have caused it to be overwritten or merged. – tripleee Apr 04 '16 at 08:57
  • However, the answer with `--assume-unchanged` has been changed to say something else now; maybe check the earlier revision. If it works for you, it could be posted as an answer here instead now. – tripleee Apr 04 '16 at 08:58
  • I did some research on --assume-unchanged and i think that is what I need, but i can not find anything about it if it works on for folders also do u know that by any change? – crasyboy42 Apr 05 '16 at 07:41
  • Quick testing indicates no. You could test this yourself, easily. – tripleee Apr 05 '16 at 08:10

1 Answers1

-1

yes, go edit your gitignore, this will ignore everything within the folder

relative/path/to/foldername/**

see https://git-scm.com/docs/gitignore for other pattern examples

chrismillah
  • 3,704
  • 2
  • 14
  • 20
  • `.gitignore` specifies files not to track, but if a file is already tracked, adding it to `.gitignore` does not remove it from the set of tracked files, nor does it prevent checking out or merging changes to the file. As per the documentation you link to; *Files already tracked by Git are not affected.* – tripleee Apr 01 '16 at 17:30
  • So, if i untrack existing files it will not include current files and new files right? – crasyboy42 Apr 02 '16 at 09:53
  • Er, not sure I understand what yeu are asking. Untracked files are files which Git does not monitor for changes or status, i.e. Git will not record any history or care whether they exist or not. – tripleee Apr 02 '16 at 19:05