Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

When uploading Unity files through SVN, can I svn:ignore the Packages folder?

Discussion in 'General Discussion' started by chealin, Apr 19, 2023.

  1. chealin

    chealin

    Joined:
    Sep 10, 2017
    Posts:
    72
    hello

    When committing files with svn, I don't know why it keeps including the "packages" folder
    I don't think the packages folder needs to be included.


    --
    My situation is as follows

    I haven't used SVN much.
    I will be collaborating using SVN.
    I saw a list to write to svn:ignore

    [
    Library
    Temp
    obj
    *.DotSettings
    *.csproj
    *.pidb
    *.sln
    *.suo
    *.unityproj
    *.user
    *.userprefs
    ]

    However, in this project, "Packages" are not targeted.

    I sometimes copy the folder in Libary-PackageCache (eg universal RP) and move it to the "Packages" subfolder and modify the code little by little.

    However, if the package is included in svn:ignore, the file will continue to be included during svn commit/update, and an error will occur. I want to avoid this situation.

    So I don't know if I shouldn't put a value in the ignor list.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,019
    Don‘t ignore Packages! The project won‘t work without it!
    The folder only contains two small text files. If you ignore manifest.json then the project has no way of telling which packages are required/installed for the project.

    Put your own copies of Packages under Assets and do not ignore them either.Treat them like user code because that‘s what it is when you modify package code.
     
    chealin likes this.
  3. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,903
    That's not the correct way. Put them under Packages/ folder. They will be still recognized as packages, but they will be editable and prevented to be installed the same unedited package again through package manager.
     
    chealin likes this.
  4. aras-p

    aras-p

    Unity Legend

    Joined:
    Feb 17, 2022
    Posts:
    67
    Ryiah and angrypenguin like this.
  5. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,124
    You shouldn't be excluding that folder. If you do you run the risk that one computer may have one release of a package and another computer has a different release leading to compatibility problems.

    Just in case this is an answer from ChatGPT (it reads very much like a response from it) be aware that GPT-3.5 and GPT-4 give bad advice on this topic. You have to specifically call it out on it to get a list of why it's a bad idea.
     
    Last edited: Apr 19, 2023
  6. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,903
    Not to mention if you modify/move a package to the
    Packages/
    folder, then you are risking losing your modifications.
    Packages/
    folder should be under version control.
     
  7. chealin

    chealin

    Joined:
    Sep 10, 2017
    Posts:
    72
    I found that I needed to include the Package in SVN.
    thank you
    We should try to avoid moving packages into Package as much as possible.