• .gitignore questions

    By Txemanu Calle 1 decade ago

    Hi,

    Checking the .gitignore file which is automatically created in the projects, I see it contains the next lines:

    nsf/.classpath
    nsf/.project
    nsf/plugin.xml
    nsf/.settings
    xspdesign.properties

    I have few questions:

    1) Is the purpose of this file avoid to commit changes in these files (.classpath, .project, plugin.xml,…)?

    2) If so, my ODP repository should be in a folder named 'nsf' ?
    For example:
    My git repo/.git
    My git repo/nsf/
    My git repo/xsl
    My git repo/.gitignore
    My git repo/.gitattributes

    3) Can I change this file (.gitignore) manually with a text editor in order to exclude other files, or just change the ODP folder? Is necessary to do something else (commit it again I suppose…)?

    Thank you very much!!

    • By Cameron Gregor 1 decade ago

      Hi Txemanu,

      1) Yes the purpose of the .gitignore file is to tell git “Do not do anything to these files IF they are not already added to the repository, pretend they don't exist”.
      Note that if you had already added a file to the repository (already tracked by git), the entries in the gitignore file have no effect. It is only used to ignore untracked files.

      2) Your ODP should definitely be in a subfolder of your repo/ folder. In my case I called it 'nsf' but you could call it anything you like and modify the .gitignore to match.
      The reason is that if you put your ODP in the root folder (e.g. my git repo/Forms, my git repo/Views) then Domino designer will also consider the .git folder as part of the ODP, it will then sync the contents of the .git folder into the actual NSF, and then the filesize of the NSF will continue to grow and grow because it will be storing all the git repository objects as well.

      3) Yes you can change .gitignore manually with a text editor. Have a read of the git manual entry for
      .gitignore for some more detailed information, you can use patterns like *.zip etc. to ignore all zip files
      Note that the .gitignore entries that Dora contributed will be within ### Dora start and ### Dora finish lines.
      Note also that if you change the entries between those lines, and then start the dora repo setup again, it will tell you that the .gitignore entries are not installed, however you can then ignore that because you DID install them but just changed them afterwards.
      In terms of commiting, you should probably commit the .gitignore contents, however the .gitignore entries will be used by git whether they are committed or not.

      Cameron

      • By Txemanu Calle 1 decade ago

        Thanks a lot! Great explanation.

        I use to create a special folder called 'Notes' for the ODP inside the git repo, and I started to implement Dora after check this Notes in 9 video: (thanks Paul!)

        http://notesin9.com/index.php/2014/03/24/sourcetreedeepdive/

        Watching the video I realized Paul creates a 'notes' folder for the ODP and then when Dora is installed, .gitignore is pointing to several “familiar” files inside 'nsf/', so here's where my confusion started.

        I did several tests, and I also realized that even changing the .gitignore paths from 'nsf/' to 'Notes/' the files were still tracked by git, you can imagine my mess (it was because they had been added to the repository previously, as you explain)

        Finally, I suppose it's necessary to install Dora in a repo BEFORE the first commit of the ODP, so the files (.classpath, .project, plugin.xml,…) listed in the .gitignore can be ignored properly by git, or at least do not track them before .gitignore is ready.

        Thank you very much for your support!

        • By Cameron Gregor 1 decade ago

          No problem, let me know if any other questions!