Uploaded image for project: 'Sourcetree for Windows'
  1. Sourcetree for Windows
  2. SRCTREEWIN-13132

Staging in a shared submodule leads to deletion of files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 3.2.2
    • Git
    • None
    • Severity 3 - Minor

    Description

      Heyho,

      I set up a shared submodule, and whenever I stage a file in Sourcetree it shows that all files contents are deleted, so effectively Sourcetree states that I am staging a deleted file. When I unstage, the file is deleted. When I add the file via the terminal, it all works flawlessly. I think the tricky thing here is the shared submodule part, with which Sourcetree has trouble. While it could be that I am doing something wrong, I have the belief that Sourcetree is doing more than a simple 'git add' (as that works from the command line).

      I set up the shared submodule as followed:

      1. Clone the project that should serve as the shared submodule locally to some directory
      2. In the shared submodule, modify the local config of this project by adding 'worktree = ..' under [core]

      For all projects sharing this submodule:

      3. Add the submodule (this means, effectively I now have two checked out copies of that project)
      4. Delete the respective submodule folder in ./git/submodule/
      5. Delete the content of the submodule directory apart from the .git file
      6. Modify the .git in the submodule directory to point to the path of the project setup in 1)

       

      (reason for shared submodule is that we have the same code base across different projects, and this way I can change a file in the code base once and it is applied to all projects without having to pull their respective submodule first)

      Attachments

        Activity

          People

            Unassigned Unassigned
            40b695fbdae3 Horschig
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: