0

I have a zip file (contains jdk) that is already committed to the remote repo, I only use this file in the remote repo (as a cicd procedure)

and what I want is that I will not be able to pull it (the zip file) from the remote, because in my local repo I have no use in it.

I think it's like the opposite to git rm --cached because what I need is the file to stay in the remote and not be in the local.

I found this thread Ignore changes to a file that is already committed but i did not understand it that much.

Does anybody know how I can not pull the file?

Levi Haskell
  • 795
  • 8
  • 20
omer
  • 1
  • 1
  • 1
    Git doesn't pull files. – evolutionxbox Feb 11 '21 at 16:30
  • what do you mean? of course it pull, i meant when i updated my local repo with the remote i don't want to pull the zip file – omer Feb 11 '21 at 16:34
  • 3
    My advice. Don't keep the zip in the repo. – evolutionxbox Feb 11 '21 at 16:39
  • why does it matter? the problem is relevant to any type of file – omer Feb 11 '21 at 17:42
  • 1
    Git doesn't pull files. It pulls commits (and the objects that go with them). --- If you would like the remote to keep the file, but remove them locally, this will have to be done after _every pull_. Don't commit the removal though, otherwise it will remove the remote repo file on the next push. – evolutionxbox Feb 11 '21 at 17:45
  • Now I understand what you were saying about the pull, and you also said here my problem that I do not want that "remove them locally" to happen after every pull. But I want to do is to address this problem like a .gitignore that ignore certain files, then I will have something similar for the files I want to ignore that are already in the commit. – omer Feb 11 '21 at 17:54
  • 1
    You can't ignore files that are already committed. – evolutionxbox Feb 11 '21 at 17:56
  • well, it solve my problem in a workaround with your advice, I decided to put the jdk in other branch(not the master), then I use this branch only for the jdk and for the actual development I am using the master as usual. so I am using 2 branches and it solve it. thanks! – omer Feb 11 '21 at 18:09
  • 1
    Just never merge that branch into the others. Otherwise you’ll be back to square one – evolutionxbox Feb 11 '21 at 18:09

0 Answers0